diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-04-05 11:54:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 11:54:08 +0200 |
commit | 77dc4c3cb6b59e826699c1590bc26b071e868216 (patch) | |
tree | 5ba2509b65b1a9e48d916616e08c593688ee5a14 /scene/gui/graph_edit.cpp | |
parent | 789646e2010632908b0569c64190b1b37e033cb8 (diff) | |
parent | 504bc5cc6719db3bcafa5f1262b95fa2a58ec0a1 (diff) |
Merge pull request #47636 from qarmin/input
Fix crashes in *_input functions
Diffstat (limited to 'scene/gui/graph_edit.cpp')
-rw-r--r-- | scene/gui/graph_edit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index b93391ee4c..65046d5d10 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -154,6 +154,8 @@ Vector2 GraphEditMinimap::_convert_to_graph_position(const Vector2 &p_position) } void GraphEditMinimap::_gui_input(const Ref<InputEvent> &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + if (!ge->is_minimap_enabled()) { return; } @@ -1066,6 +1068,8 @@ void GraphEdit::set_selected(Node *p_child) { } void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) { + ERR_FAIL_COND(p_ev.is_null()); + Ref<InputEventMouseMotion> mm = p_ev; if (mm.is_valid() && (mm->get_button_mask() & MOUSE_BUTTON_MASK_MIDDLE || (mm->get_button_mask() & MOUSE_BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE)))) { h_scroll->set_value(h_scroll->get_value() - mm->get_relative().x); |