diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 2906ade42e6..c0eba637c3b 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -597,6 +597,7 @@ void AnimationBezierTrackEdit::_select_at_anim(const Ref &p_anim, int } void AnimationBezierTrackEdit::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); if (p_event->is_pressed()) { if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) { diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index 13a5d00782d..6274c5662f0 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -2654,6 +2654,8 @@ String AnimationTrackEdit::get_tooltip(const Point2 &p_pos) const { } void AnimationTrackEdit::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (p_event->is_pressed()) { if (ED_GET_SHORTCUT("animation_editor/duplicate_selection")->is_shortcut(p_event)) { emit_signal("duplicate_request"); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 5b95d405f1e..55b733e5f5c 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -58,7 +58,6 @@ void EditorHelp::_init_colors() { } void EditorHelp::_unhandled_key_input(const Ref &p_ev) { - if (!is_visible_in_tree()) return; diff --git a/editor/plugins/animation_player_editor_plugin.cpp b/editor/plugins/animation_player_editor_plugin.cpp index 8477c1f1ec4..ea43c0b31fd 100644 --- a/editor/plugins/animation_player_editor_plugin.cpp +++ b/editor/plugins/animation_player_editor_plugin.cpp @@ -1265,6 +1265,7 @@ void AnimationPlayerEditor::_onion_skinning_menu(int p_option) { } void AnimationPlayerEditor::_unhandled_key_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); Ref k = p_ev; if (is_visible_in_tree() && k.is_valid() && k->is_pressed() && !k->is_echo() && !k->get_alt() && !k->get_control() && !k->get_metakey()) { diff --git a/editor/plugins/canvas_item_editor_plugin.cpp b/editor/plugins/canvas_item_editor_plugin.cpp index 0b7178ab087..9844347bacb 100644 --- a/editor/plugins/canvas_item_editor_plugin.cpp +++ b/editor/plugins/canvas_item_editor_plugin.cpp @@ -468,6 +468,7 @@ float CanvasItemEditor::snap_angle(float p_target, float p_start) const { } void CanvasItemEditor::_unhandled_key_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); Ref k = p_ev; diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index ca3f76b882b..f17cdac4cfe 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -2641,6 +2641,8 @@ void ScriptEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Co } void ScriptEditor::_unhandled_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (!is_visible_in_tree() || !p_event->is_pressed() || p_event->is_echo()) return; if (ED_IS_SHORTCUT("script_editor/next_script", p_event)) { diff --git a/editor/plugins/spatial_editor_plugin.cpp b/editor/plugins/spatial_editor_plugin.cpp index 0f152b08621..e70ca576f55 100644 --- a/editor/plugins/spatial_editor_plugin.cpp +++ b/editor/plugins/spatial_editor_plugin.cpp @@ -6023,6 +6023,7 @@ void SpatialEditor::snap_selected_nodes_to_floor() { } void SpatialEditor::_unhandled_key_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); if (!is_visible_in_tree() || get_viewport()->gui_has_modal_stack()) return; diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp index 8076a4e7bd0..4fa0112f7ef 100644 --- a/editor/scene_tree_dock.cpp +++ b/editor/scene_tree_dock.cpp @@ -70,6 +70,7 @@ void SceneTreeDock::_input(Ref p_event) { } void SceneTreeDock::_unhandled_key_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); if (get_viewport()->get_modal_stack_top()) return; //ignore because of modal window diff --git a/scene/2d/touch_screen_button.cpp b/scene/2d/touch_screen_button.cpp index 00dbaa3668e..d5d2c116a57 100644 --- a/scene/2d/touch_screen_button.cpp +++ b/scene/2d/touch_screen_button.cpp @@ -191,6 +191,7 @@ String TouchScreenButton::get_action() const { } void TouchScreenButton::_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); if (!get_tree()) return; diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 9915ecea105..1c5e70a5f3f 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -52,6 +52,7 @@ void BaseButton::_unpress_group() { } void BaseButton::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); if (status.disabled) // no interaction with disabled button return; @@ -355,6 +356,7 @@ Ref BaseButton::get_shortcut() const { } void BaseButton::_unhandled_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); if (!is_disabled() && is_visible_in_tree() && !p_event->is_echo() && shortcut.is_valid() && shortcut->is_shortcut(p_event)) { diff --git a/scene/gui/item_list.cpp b/scene/gui/item_list.cpp index 0b36277baea..f9abb6d7668 100644 --- a/scene/gui/item_list.cpp +++ b/scene/gui/item_list.cpp @@ -471,6 +471,7 @@ Size2 ItemList::Item::get_icon_size() const { } void ItemList::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); double prev_scroll = scroll_bar->get_value(); diff --git a/scene/gui/menu_button.cpp b/scene/gui/menu_button.cpp index d140fa1df89..262c820adc8 100644 --- a/scene/gui/menu_button.cpp +++ b/scene/gui/menu_button.cpp @@ -33,6 +33,7 @@ #include "scene/main/viewport.h" void MenuButton::_unhandled_key_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); if (disable_shortcuts) return; diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 8954fcca15d..86252ddb2b5 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -214,6 +214,7 @@ void PopupMenu::_scroll(float p_factor, const Point2 &p_over) { } void PopupMenu::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); if (p_event->is_action("ui_down") && p_event->is_pressed()) { diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 4ab41e9166f..5aa4c3f5915 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -42,6 +42,7 @@ void ScrollBar::set_can_focus_by_default(bool p_can_focus) { } void ScrollBar::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); Ref m = p_event; if (!m.is_valid() || drag.active) { diff --git a/scene/gui/viewport_container.cpp b/scene/gui/viewport_container.cpp index 10e41689402..4900fcaac46 100644 --- a/scene/gui/viewport_container.cpp +++ b/scene/gui/viewport_container.cpp @@ -143,6 +143,7 @@ void ViewportContainer::_notification(int p_what) { } void ViewportContainer::_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); if (Engine::get_singleton()->is_editor_hint()) return; @@ -168,6 +169,7 @@ void ViewportContainer::_input(const Ref &p_event) { } void ViewportContainer::_unhandled_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); if (Engine::get_singleton()->is_editor_hint()) return;