diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 8391eddc598c..6f54a1c57af9 100644 --- a/editor/plugin_config_dialog.cpp +++ b/editor/plugin_config_dialog.cpp @@ -60,7 +60,11 @@ void PluginConfigDialog::_on_confirmed() { } int lang_idx = script_option_edit->get_selected(); - String ext = ScriptServer::get_language(lang_idx)->get_extension(); + ScriptLanguage *language = ScriptServer::get_language(lang_idx); + if (language == nullptr) { + return; + } + String ext = language->get_extension(); String script_name = script_edit->get_text().is_empty() ? _get_subfolder() : script_edit->get_text(); if (script_name.get_extension() != ext) { script_name += "." + ext; @@ -79,11 +83,11 @@ void PluginConfigDialog::_on_confirmed() { if (!_edit_mode) { String class_name = script_name.get_basename(); String template_content = ""; - Vector templates = ScriptServer::get_language(lang_idx)->get_built_in_templates("EditorPlugin"); + Vector templates = language->get_built_in_templates("EditorPlugin"); if (!templates.is_empty()) { template_content = templates[0].content; } - Ref