### 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)

file_dialog_option = -1;
		} break;
		case FILE_SAVE_AS: {
			ScriptEditorBase *current = _get_current_editor();
			if (current) {
				Ref<Resource> resource = current->get_edited_resource();
				String path = ProjectSettings::get_singleton()->localize_path(p_file);
				Error err = _save_text_file(resource, path);
				if (err != OK) {
					EditorNode::get_singleton()->show_accept(TTR("Error saving file!"), TTR("OK"));
					return;
				}
				resource->set_path(path);
				_update_script_names();
			}
		} break;
		case THEME_SAVE_AS: {
			if (!EditorSettings::get_singleton()->save_text_editor_theme_as(p_file)) {
				EditorNode::get_singleton()->show_warning(TTR("Error while saving theme."), TTR("Error Saving"));
			}
		} break;
		case THEME_IMPORT: {
			if (!EditorSettings::get_singleton()->import_text_editor_theme(p_file)) {
				EditorNode::get_singleton()->show_warning(TTR("Error importing theme."), TTR("Error Importing"));
			}
		} break;
	}
	file_dialog_option = -1;
}
Ref<Script> ScriptEditor::_get_current_script() {