fix(config): skip persisting empty API key and compat entries

This commit is contained in:
hkfires
2025-10-31 15:56:47 +08:00
parent 4883349795
commit 2021ae3891
2 changed files with 31 additions and 1 deletions

View File

@@ -116,7 +116,7 @@ func sanitizeStringSlice(in []string) []string {
func geminiKeyStringsFromConfig(cfg *config.Config) []string {
if cfg == nil || len(cfg.GeminiKey) == 0 {
return []string{}
return nil
}
out := make([]string, 0, len(cfg.GeminiKey))
for i := range cfg.GeminiKey {