summaryrefslogtreecommitdiffstats
path: root/editor/editor_inspector.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-12-23 11:26:32 +0100
committerkobewi <kobewi4e@gmail.com>2024-06-26 13:10:08 +0200
commitf0da5cac7b6e52141d0013ce26a89f68cab10894 (patch)
tree9a4b5818aab6ba0f3e788e789f7b95a4112bb38a /editor/editor_inspector.cpp
parent95110ddcb41ba4b9b1f8c9bf58c8910f6616e60a (diff)
downloadredot-engine-f0da5cac7b6e52141d0013ce26a89f68cab10894.tar.gz
Always call _can_handle() before _parse_property()
Diffstat (limited to 'editor/editor_inspector.cpp')
-rw-r--r--editor/editor_inspector.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp
index 6c26231a4b..81d9510033 100644
--- a/editor/editor_inspector.cpp
+++ b/editor/editor_inspector.cpp
@@ -2598,6 +2598,10 @@ int EditorInspector::inspector_plugin_count = 0;
EditorProperty *EditorInspector::instantiate_property_editor(Object *p_object, const Variant::Type p_type, const String &p_path, PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) {
for (int i = inspector_plugin_count - 1; i >= 0; i--) {
+ if (!inspector_plugins[i]->can_handle(p_object)) {
+ continue;
+ }
+
inspector_plugins[i]->parse_property(p_object, p_type, p_path, p_hint, p_hint_text, p_usage, p_wide);
if (inspector_plugins[i]->added_editors.size()) {
for (List<EditorInspectorPlugin::AddedEditor>::Element *E = inspector_plugins[i]->added_editors.front()->next(); E; E = E->next()) { //only keep first one