Skip to content

Commit b0da1c7

Browse files
committed
Merge pull request #110041 from Ivorforce/scene-tree-notification-no-root
Make `SceneTree` not crash when receiving a notification without a root being set
2 parents f851db1 + 45a0d2a commit b0da1c7

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)