fix for FlexibleStringSlice cause picoclaw start crash issue (#2078)
This commit is contained in:
1 parent
25ce52715d
commit
0c9e4f0658
1 file changed
+7
-1
@@ -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))
|
||||
|
||||
Reference in new issue
Block a user