fix for FlexibleStringSlice cause picoclaw start crash issue (#2078)

This commit is contained in:
Cytown
2026-03-27 20:49:51 +08:00
committed by GitHub
parent 25ce52715d
commit 0c9e4f0658
+7 -1
View File
@@ -53,7 +53,13 @@ func (f *FlexibleStringSlice) UnmarshalJSON(data []byte) error {
// Try []interface{} to handle mixed types
var raw []any
if err := json.Unmarshal(data, &raw); err != nil {
return err
var s string
// fail over to compatible to old format string
if err = json.Unmarshal(data, &s); err != nil {
return err
}
*f = []string{s}
return nil
}
result := make([]string, 0, len(raw))