From 1c1b8a0c222ef3b205a9292d4b6fc9af28419292 Mon Sep 17 00:00:00 2001 From: kobewi Date: Wed, 24 Dec 2025 10:22:32 +0100 Subject: [PATCH] Fix reopening rootless scenes --- editor/editor_node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index b05c0d85f8..467b779d7d 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -4046,9 +4046,9 @@ void EditorNode::_discard_changes(const String &p_str) { switch (current_menu_option) { case SCENE_CLOSE: case SCENE_TAB_CLOSE: { - Node *scene = editor_data.get_edited_scene_root(tab_closing_idx); - if (scene != nullptr) { - _update_prev_closed_scenes(scene->get_scene_file_path(), true); + const String path = editor_data.get_scene_path(tab_closing_idx); + if (!path.is_empty()) { + _update_prev_closed_scenes(path, true); } // Don't close tabs when exiting the editor (required for "restore_scenes_on_load" setting).