1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Fix crash when closing a TextFile

This commit is contained in:
Paulb23
2020-07-16 15:50:23 +01:00
parent 9e34ba4855
commit 54bca425b2

View File

@@ -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(); Ref<Script> script = current->get_edited_resource();
if (p_save) { if (p_save) {
// Do not try to save internal scripts // 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); _menu_option(FILE_SAVE);
} }
} }