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

Make `SceneTree` not crash when receiving a notification without a root being set.

Lukas Tenbrink преди 1 месец
родител
ревизия
45a0d2a90a
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      scene/main/scene_tree.cpp

+ 4 - 0
scene/main/scene_tree.cpp

@@ -897,6 +897,10 @@ void SceneTree::_main_window_focus_in() {
 }
 
 void SceneTree::_notification(int p_notification) {
+	if (!get_root()) {
+		return;
+	}
+
 	switch (p_notification) {
 		case NOTIFICATION_TRANSLATION_CHANGED: {
 			get_root()->propagate_notification(p_notification);