From 1836f5c7a44b5fabcd4ff0122f21e4a4b2545ed9 Mon Sep 17 00:00:00 2001 From: Jacob Sanders Date: Mon, 11 Mar 2024 03:14:51 -0400 Subject: [PATCH] Update plugin_config_dialog.cpp --- editor/plugin_config_dialog.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/editor/plugin_config_dialog.cpp b/editor/plugin_config_dialog.cpp index 8391eddc598..6f54a1c57af 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