From 45a0d2a90a135e73cab97736065821740353548e Mon Sep 17 00:00:00 2001 From: Lukas Tenbrink Date: Thu, 28 Aug 2025 01:38:27 +0200 Subject: [PATCH] Make `SceneTree` not crash when receiving a notification without a root being set. --- scene/main/scene_tree.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 210c361fab..4c137004ec 100644 --- a/scene/main/scene_tree.cpp +++ b/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);