Преглед на файлове

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

(cherry picked from commit 09f974b21dcd153d3c1627368ba4d4931a06e1b5)
Marius Hanl преди 2 години
родител
ревизия
fab73c6c7e
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  1. 2 0
      scene/gui/tree.cpp

+ 2 - 0
scene/gui/tree.cpp

@@ -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();