From 454befc880f391448bbd1dce56a38897f5dd3037 Mon Sep 17 00:00:00 2001 From: Alex Drozd Date: Mon, 12 Jun 2023 20:00:42 +0200 Subject: [PATCH] Prevent non-existent scene from being saved to persistent editor config --- editor/editor_node.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 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() {