From 09f974b21dcd153d3c1627368ba4d4931a06e1b5 Mon Sep 17 00:00:00 2001 From: Marius Hanl Date: Thu, 15 Dec 2022 17:35:53 +0100 Subject: [PATCH] Check for null event in Tree._gui_input to avoid engine crash --- scene/gui/tree.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index b097a313df1..de3e416d6be 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2175,6 +2175,8 @@ void Tree::_go_down() { } void Tree::_gui_input(Ref p_event) { + ERR_FAIL_COND(p_event.is_null()); + Ref k = p_event; bool is_command = k.is_valid() && k->get_command();