Fix crash when accessing invalid fields

fixes #8104
Compat: Fix event_handler_enabled dump based on enable_event_handler attribute

fixes #8105