summaryrefslogtreecommitdiff
path: root/editor/editor_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_node.cpp')
-rw-r--r--editor/editor_node.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 73562e0695..849b053357 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2262,7 +2262,7 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
int scene_idx = (p_option == FILE_SAVE_SCENE) ? -1 : tab_closing;
Node *scene = editor_data.get_edited_scene_root(scene_idx);
- if (scene && scene->get_filename() != "") {
+ if (scene && scene->get_filename() != "" && FileAccess::exists(scene->get_filename())) {
if (scene_idx != editor_data.get_edited_scene()) {
_save_scene_with_preview(scene->get_filename(), scene_idx);
} else {
@@ -2307,11 +2307,12 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
}
if (scene->get_filename() != "") {
- file->set_current_path(scene->get_filename());
+ String path = scene->get_filename();
+ file->set_current_path(path);
if (extensions.size()) {
- String ext = scene->get_filename().get_extension().to_lower();
+ String ext = path.get_extension().to_lower();
if (extensions.find(ext) == nullptr) {
- file->set_current_path(scene->get_filename().replacen("." + ext, "." + extensions.front()->get()));
+ file->set_current_path(path.replacen("." + ext, "." + extensions.front()->get()));
}
}
} else {