diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-21 21:08:39 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-21 21:08:39 +0200 |
commit | 22ed721d15f740d0de3960d21fe58c3e9199f520 (patch) | |
tree | 61e0c5f3eae93f87837f2c53de186c928b1b70b1 /editor/plugins/script_editor_plugin.cpp | |
parent | e73de413dbcb1dcde0eab61825570a9c11b1550f (diff) | |
parent | 54bca425b2443cc8e3fd7299cd8108bcad1729b4 (diff) |
Merge pull request #40448 from Paulb23/fix_txt_close_crash
Fix crash when closing a TextFile
Diffstat (limited to 'editor/plugins/script_editor_plugin.cpp')
-rw-r--r-- | editor/plugins/script_editor_plugin.cpp | 2 |
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); } } |