summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2018-11-21 12:18:15 +0100
committerGitHub <noreply@github.com>2018-11-21 12:18:15 +0100
commit998d3a30a5601704cbd6a6233e316d2e47217ebc (patch)
tree0e52e9333d7d9fb5149a188d12dccf88ac635478
parentdcf82065e959e632b15bc4ea4a0ebdf52503f8b8 (diff)
parent9e36f5f6f8da7f41f82208dbcc4e9be3b0a75e8d (diff)
downloadredot-engine-998d3a30a5601704cbd6a6233e316d2e47217ebc.tar.gz
Merge pull request #22983 from Ashafix/master
Better error message for malformed plugins
-rw-r--r--editor/editor_node.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 1b77b04a05..5d29acff75 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -2568,6 +2568,12 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled)
return;
}
+ //errors in the script cause the base_type to be ""
+ if (String(script->get_instance_base_type()) == "") {
+ show_warning(vformat(TTR("Unable to load addon script from path: '%s' There seems to be an error in the code, please check the syntax."), path));
+ return;
+ }
+
//could check inheritance..
if (String(script->get_instance_base_type()) != "EditorPlugin") {
show_warning(vformat(TTR("Unable to load addon script from path: '%s' Base type is not EditorPlugin."), path));