From e42c1b6da89ec4526629943d67fb7b0ac4e7bdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A6=99=E8=8D=89=E5=91=B3=E7=9A=84=E7=BA=B3=E8=A5=BF?= =?UTF-8?q?=E5=A6=B2=E5=96=B5?= <151599587+VanillaNahida@users.noreply.github.com> Date: Tue, 3 Feb 2026 20:40:47 +0800 Subject: [PATCH] fix: add error handling to avoid ghost plugins (#4836) * fix: add error handling to avoid ghost plugins Add null checks to filter out incomplete plugin metadata objects that would appear as ghost plugins in the API response. This fix ensures that plugins with all null key fields (name, author, desc, version, display_name) are not included in the plugin list response, preventing ghost plugins from appearing in the UI. Issue: #4833 * fix: improve ghost plugin detection logic for better accuracy --------- Co-authored-by: Soulter <905617992@qq.com> --- astrbot/dashboard/routes/plugin.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/astrbot/dashboard/routes/plugin.py b/astrbot/dashboard/routes/plugin.py index e6c03fe89..b6160ff1e 100644 --- a/astrbot/dashboard/routes/plugin.py +++ b/astrbot/dashboard/routes/plugin.py @@ -315,6 +315,17 @@ class PluginRoute(Route): "display_name": plugin.display_name, "logo": f"/api/file/{logo_url}" if logo_url else None, } + # 检查是否为全空的幽灵插件 + if not any( + [ + plugin.name, + plugin.author, + plugin.desc, + plugin.version, + plugin.display_name, + ] + ): + continue _plugin_resp.append(_t) return ( Response()