summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorPaulb23 <p_batty@hotmail.co.uk>2020-07-16 15:50:23 +0100
committerPaulb23 <p_batty@hotmail.co.uk>2020-07-16 15:50:23 +0100
commit54bca425b2443cc8e3fd7299cd8108bcad1729b4 (patch)
treefeda0e87e5292c72c099e4c0edeb66447203ee9f /editor
parent9e34ba48556b71f1f672b5be47d12b0e3f679b86 (diff)
Fix crash when closing a TextFile
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/script_editor_plugin.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 4f783f4e27..71830d0464 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -701,7 +701,7 @@ void ScriptEditor::_close_tab(int p_idx, bool p_save, bool p_history_back) {
Ref<Script> script = current->get_edited_resource();
if (p_save) {
// Do not try to save internal scripts
- if (!(script->get_path() == "" || script->get_path().find("local://") != -1 || script->get_path().find("::") != -1)) {
+ if (!script.is_valid() || !(script->get_path() == "" || script->get_path().find("local://") != -1 || script->get_path().find("::") != -1)) {
_menu_option(FILE_SAVE);
}
}