Guard against nil in inherited_options hash

Fixes #28188.