summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-12 22:56:46 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-12 22:56:46 +0200
commita5206e449ead208b6cb79a3731ef58bf871d5f05 (patch)
tree2a316d72d06ef4c82ce462f934303616efbddd44
parentc43b6b5ac8d6c464d1e24a691d7901190400a32f (diff)
parent454befc880f391448bbd1dce56a38897f5dd3037 (diff)
downloadredot-engine-a5206e449ead208b6cb79a3731ef58bf871d5f05.tar.gz
Merge pull request #78152 from brno32/editor-persistence-empty-scene-fix
Prevent non-existent scene from being saved to persistent editor config
-rw-r--r--editor/editor_node.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index c18978cc0d..1bcfc431dc 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -4932,7 +4932,10 @@ void EditorNode::_save_open_scenes_to_config(Ref<ConfigFile> p_layout) {
p_layout->set_value(EDITOR_NODE_CONFIG_SECTION, "open_scenes", scenes);
String currently_edited_scene_path = editor_data.get_scene_path(editor_data.get_edited_scene());
- p_layout->set_value(EDITOR_NODE_CONFIG_SECTION, "current_scene", currently_edited_scene_path);
+ // Don't save a bad path to the config.
+ if (!currently_edited_scene_path.is_empty()) {
+ p_layout->set_value(EDITOR_NODE_CONFIG_SECTION, "current_scene", currently_edited_scene_path);
+ }
}
void EditorNode::save_editor_layout_delayed() {