Skip to content

Commit

Permalink
Merge pull request #40448 from Paulb23/fix_txt_close_crash
Browse files Browse the repository at this point in the history
Fix crash when closing a TextFile
  • Loading branch information
akien-mga authored Jul 21, 2020
2 parents e73de41 + 54bca42 commit 22ed721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor/plugins/script_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 22ed721

Please sign in to comment.