Skip to content

Commit 45a0d2a

Browse files
committed
Make SceneTree not crash when receiving a notification without a root being set.
1 parent 21fbf03 commit 45a0d2a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scene/main/scene_tree.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,10 @@ void SceneTree::_main_window_focus_in() {
897897
}
898898

899899
void SceneTree::_notification(int p_notification) {
900+
if (!get_root()) {
901+
return;
902+
}
903+
900904
switch (p_notification) {
901905
case NOTIFICATION_TRANSLATION_CHANGED: {
902906
get_root()->propagate_notification(p_notification);

0 commit comments

Comments
 (0)