### Godot version

4.0 beta 12 mono

### System information

MacOS 13.1, Apple M1 Pro

### Issue description

When `text_editor/external/use_external_editor` is set to true but `text_editor/external/exec_path` is not set and I create a new script and attach it to a node Godot freezes and i need to force quit the application.
Also after a restart when double clicking on the script the application freezes but I can quit normally

### Steps to reproduce

- Set Use External Editor to true in Editor Settings and leave Exec Path empty
- Create a new project with Moblie Renderer and Git Versioning in Godot
- Create a 3D Scene
- Create a gd script in the FileSystem inspector or directly attach the script to a node

### Minimal reproduction project

[New Game Project.zip](https://github.com/godotengine/godot/files/10420510/New.Game.Project.zip)

if (last_date == date) {
				continue;
			}
			Ref<Script> scr = edited_res;
			if (scr != nullptr) {
				Ref<Script> rel_scr = ResourceLoader::load(scr->get_path(), scr->get_class(), ResourceFormatLoader::CACHE_MODE_IGNORE);
				ERR_CONTINUE(!rel_scr.is_valid());
				scr->set_source_code(rel_scr->get_source_code());
				scr->set_last_modified_time(rel_scr->get_last_modified_time());
				scr->reload(true);
			}
			Ref<TextFile> text_file = edited_res;
			if (text_file != nullptr) {
				Error err;
				Ref<TextFile> rel_text_file = _load_text_file(text_file->get_path(), &err);
				ERR_CONTINUE(!rel_text_file.is_valid());
				text_file->set_text(rel_text_file->get_text());
				text_file->set_last_modified_time(rel_text_file->get_last_modified_time());
			}
		}
		se->reload_text();
	}
	disk_changed->hide();
	_update_script_names();
}
void ScriptEditor::open_script_create_dialog(const String &p_base_name, const String &p_base_path) {
	_menu_option(FILE_NEW);
	script_create_dialog->config(p_base_name, p_base_path);
}
void ScriptEditor::open_text_file_create_dialog(const String &p_base_path, const String &p_base_name) {