From 8e1e0d4b4259015895cbe732634e1cf177840a8e Mon Sep 17 00:00:00 2001 From: Jamie Pate Date: Tue, 16 Jul 2024 13:28:45 -0700 Subject: [PATCH] Fix Crash when adding scenes with a group to the level scene Fixes #94274 --- editor/groups_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index 6cfc035fc9f4..a5f7e8556cad 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -275,6 +275,11 @@ void GroupsEditor::_queue_update_groups_and_tree() { void GroupsEditor::_update_groups_and_tree() { update_groups_and_tree_queued = false; + // The scene_root_node could be unset before we actually run this code because this is queued with call_deferred(). + // In that case NOTIFICATION_VISIBILITY_CHANGED will call this function again soon. + if (!scene_root_node) { + return; + } _update_groups(); _update_tree(); }