diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index e2897c2d283..48d8d0618f5 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -106,6 +106,8 @@ bool WindowDialog::has_point(const Point2 &p_point) const { } void WindowDialog::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref mb = p_event; if (mb.is_valid() && mb->get_button_index() == BUTTON_LEFT) { diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 2709c3a97cf..f9d07d3fd37 100644 --- a/scene/gui/file_dialog.cpp +++ b/scene/gui/file_dialog.cpp @@ -78,6 +78,8 @@ void FileDialog::_notification(int p_what) { } void FileDialog::_unhandled_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref k = p_event; if (k.is_valid() && is_window_modal_on_top()) { if (k->is_pressed()) { diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 073937e7aab..4895f30be9b 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1098,6 +1098,8 @@ void GraphEdit::set_selected(Node *p_child) { } void GraphEdit::_gui_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + Ref mm = p_ev; if (mm.is_valid() && (mm->get_button_mask() & BUTTON_MASK_MIDDLE || (mm->get_button_mask() & BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) { Vector2i relative = Input::get_singleton()->warp_mouse_motion(mm, get_global_rect()); diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp index a8735b23e0d..83d1fc729ac 100644 --- a/scene/gui/graph_node.cpp +++ b/scene/gui/graph_node.cpp @@ -746,6 +746,8 @@ Color GraphNode::get_connection_output_color(int p_idx) { } void GraphNode::_gui_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + Ref mb = p_ev; if (mb.is_valid()) { ERR_FAIL_COND_MSG(get_parent_control() == nullptr, "GraphNode must be the child of a GraphEdit node."); diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index ac2c8fdf755..fba315f3281 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -49,6 +49,8 @@ static bool _is_text_char(CharType c) { } void LineEdit::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref b = p_event; if (b.is_valid()) { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index 34e9d906a8e..bf1b5f40d50 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -1164,6 +1164,8 @@ Control::CursorShape RichTextLabel::get_cursor_shape(const Point2 &p_pos) const } void RichTextLabel::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref b = p_event; if (b.is_valid()) { diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 086eba0d491..53b900800e1 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -88,6 +88,8 @@ void ScrollContainer::_cancel_drag() { } void ScrollContainer::_gui_input(const Ref &p_gui_input) { + ERR_FAIL_COND(p_gui_input.is_null()); + double prev_v_scroll = v_scroll->get_value(); double prev_h_scroll = h_scroll->get_value(); diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 27dde462c22..fa7445941e4 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -46,6 +46,8 @@ Size2 Slider::get_minimum_size() const { } void Slider::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (!editable) { return; } diff --git a/scene/gui/spin_box.cpp b/scene/gui/spin_box.cpp index 0fec9399c1e..9c60b736001 100644 --- a/scene/gui/spin_box.cpp +++ b/scene/gui/spin_box.cpp @@ -101,6 +101,8 @@ void SpinBox::_release_mouse() { } void SpinBox::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (!is_editable()) { return; } diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index a5c1af56cd2..99199f5f4d6 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -196,6 +196,8 @@ void SplitContainer::_notification(int p_what) { } void SplitContainer::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + if (collapsed || !_getch(0) || !_getch(1) || dragger_visibility != DRAGGER_VISIBLE) { return; } diff --git a/scene/gui/tab_container.cpp b/scene/gui/tab_container.cpp index 4a42d243151..d458f33a9a4 100644 --- a/scene/gui/tab_container.cpp +++ b/scene/gui/tab_container.cpp @@ -69,6 +69,8 @@ int TabContainer::_get_top_margin() const { } void TabContainer::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref mb = p_event; Popup *popup = get_popup(); diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index 6526fc781b4..c787a64e395 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -84,6 +84,8 @@ Size2 Tabs::get_minimum_size() const { } void Tabs::_gui_input(const Ref &p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref mm = p_event; if (mm.is_valid()) { diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 63b83cbb331..78a0851de45 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -2402,6 +2402,8 @@ void TextEdit::_get_minimap_mouse_row(const Point2i &p_mouse, int &r_row) const } void TextEdit::_gui_input(const Ref &p_gui_input) { + ERR_FAIL_COND(p_gui_input.is_null()); + double prev_v_scroll = v_scroll->get_value(); double prev_h_scroll = h_scroll->get_value(); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index c7a33585b57..ae29e7977d4 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1414,6 +1414,8 @@ void Viewport::_vp_input_text(const String &p_text) { } void Viewport::_vp_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + if (disable_input) { return; } @@ -1436,6 +1438,8 @@ void Viewport::_vp_input(const Ref &p_ev) { } void Viewport::_vp_unhandled_input(const Ref &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + if (disable_input) { return; }