diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index e1fae470573..a6cd07dab33 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -2194,10 +2194,7 @@ void EditorInspector::remove_inspector_plugin(const Ref & for (int i = idx; i < inspector_plugin_count - 1; i++) { inspector_plugins[i] = inspector_plugins[i + 1]; } - - if (idx == inspector_plugin_count - 1) { - inspector_plugins[idx] = Ref(); - } + inspector_plugins[inspector_plugin_count - 1] = Ref(); inspector_plugin_count--; }