Check for null event in Tree._gui_input to avoid engine crash

(cherry picked from commit 09f974b21d)
This commit is contained in:
Marius Hanl 2022-12-15 17:35:53 +01:00 committed by Rémi Verschelde
parent d13e327abe
commit fab73c6c7e
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -2175,6 +2175,8 @@ void Tree::_go_down() {
} }
void Tree::_gui_input(Ref<InputEvent> p_event) { void Tree::_gui_input(Ref<InputEvent> p_event) {
ERR_FAIL_COND(p_event.is_null());
Ref<InputEventKey> k = p_event; Ref<InputEventKey> k = p_event;
bool is_command = k.is_valid() && k->get_command(); bool is_command = k.is_valid() && k->get_command();