diff options
author | Ashafix <maximili.peters@mail.huji.ac.il> | 2018-10-13 14:20:18 +0200 |
---|---|---|
committer | Ashafix <maximili.peters@mail.huji.ac.il> | 2018-10-25 22:46:01 +0200 |
commit | 9e36f5f6f8da7f41f82208dbcc4e9be3b0a75e8d (patch) | |
tree | 47b1d2b5bf2ae74a6a6feceb63a8495f41954002 /editor | |
parent | 43c28681add010b5daccbcfde3e3065d7be7b52c (diff) |
Better error message for malformed plugins
Diffstat (limited to 'editor')
-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 18dd85617b..813709859e 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -2551,6 +2551,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)); |