1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Prevent crash attaching a script with no languages registered

This commit is contained in:
Andrii Doroshenko (Xrayez)
2020-05-31 20:31:45 +03:00
parent a8787d1ae5
commit 52f3cfca6f
2 changed files with 9 additions and 3 deletions

View File

@@ -2557,6 +2557,11 @@ void SceneTreeDock::_focus_node() {
}
void SceneTreeDock::attach_script_to_selected(bool p_extend) {
if (ScriptServer::get_language_count() == 0) {
EditorNode::get_singleton()->show_warning(TTR("Cannot attach a script: there are no languages registered.\nThis is probably because this editor was built with all language modules disabled."));
return;
}
if (!profile_allow_script_editing) {
return;
}