Skip to content

Commit

Permalink
Prevent non-existent scene from being saved to persistent editor config
Browse files Browse the repository at this point in the history
  • Loading branch information
brno32 committed Jun 12, 2023
1 parent 593d5ca commit 454befc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 454befc

Please sign in to comment.