diff options
author | Max Hilbrunner <mhilbrunner@users.noreply.github.com> | 2018-11-21 12:18:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-21 12:18:15 +0100 |
commit | 998d3a30a5601704cbd6a6233e316d2e47217ebc (patch) | |
tree | 0e52e9333d7d9fb5149a188d12dccf88ac635478 | |
parent | dcf82065e959e632b15bc4ea4a0ebdf52503f8b8 (diff) | |
parent | 9e36f5f6f8da7f41f82208dbcc4e9be3b0a75e8d (diff) | |
download | redot-engine-998d3a30a5601704cbd6a6233e316d2e47217ebc.tar.gz |
Merge pull request #22983 from Ashafix/master
Better error message for malformed plugins
-rw-r--r-- | editor/editor_node.cpp | 6 |
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)); |