From 6f3bd7641b46793a7273de8b2ef033db05f52b3b Mon Sep 17 00:00:00 2001 From: LTbinglingfeng Date: Mon, 15 Jun 2026 01:21:07 +0800 Subject: [PATCH] feat(pluginstore): improve nil checks in pluginStoreSnapshot function --- internal/api/handlers/management/plugin_store.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/api/handlers/management/plugin_store.go b/internal/api/handlers/management/plugin_store.go index c123d2df..a41aae3c 100644 --- a/internal/api/handlers/management/plugin_store.go +++ b/internal/api/handlers/management/plugin_store.go @@ -311,11 +311,14 @@ func (h *Handler) enablePluginConfigLocked(id string) error { } func (h *Handler) pluginStoreSnapshot() (bool, string, string, []string, map[string]config.PluginInstanceConfig, *pluginhost.Host) { - if h == nil || h.cfg == nil { + if h == nil { return false, "plugins", "", nil, map[string]config.PluginInstanceConfig{}, nil } h.mu.Lock() defer h.mu.Unlock() + if h.cfg == nil { + return false, "plugins", "", nil, map[string]config.PluginInstanceConfig{}, nil + } pluginsEnabled := h.cfg.Plugins.Enabled pluginsDir := normalizedPluginsDir(h.cfg.Plugins.Dir) proxyURL := strings.TrimSpace(h.cfg.ProxyURL)