Pārlūkot izejas kodu

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

Lukas Tenbrink 1 nedēļu atpakaļ
vecāks
revīzija
45a0d2a90a
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  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);