mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 16:58:11 +08:00
go-ipfs-config: Merge pull request #12 from ipfs/fix/null-string
Fix handling of null strings
This commit is contained in:
commit
3258968331
@ -17,7 +17,11 @@ func (o *Strings) UnmarshalJSON(data []byte) error {
|
||||
if err := json.Unmarshal(data, &value); err != nil {
|
||||
return err
|
||||
}
|
||||
*o = []string{value}
|
||||
if len(value) == 0 {
|
||||
*o = []string{}
|
||||
} else {
|
||||
*o = []string{value}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user