소스 검색

Merge pull request #40448 from Paulb23/fix_txt_close_crash

Fix crash when closing a TextFile
Rémi Verschelde 5 년 전
부모
커밋
22ed721d15
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      editor/plugins/script_editor_plugin.cpp

+ 1 - 1
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);
 			}
 		}