Просмотр исходного кода

Merge pull request #94450 from jamie-pate/fix_94274

Fix crash when adding scenes with a group to the level scene
Rémi Verschelde 1 год назад
Родитель
Сommit
2549205aa8
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      editor/groups_editor.cpp

+ 5 - 0
editor/groups_editor.cpp

@@ -275,6 +275,11 @@ void GroupsEditor::_queue_update_groups_and_tree() {
 
 
 void GroupsEditor::_update_groups_and_tree() {
 void GroupsEditor::_update_groups_and_tree() {
 	update_groups_and_tree_queued = false;
 	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_groups();
 	_update_tree();
 	_update_tree();
 }
 }