Skip to content

Commit

Permalink
go-ipfs-config: Merge pull request ipfs#12 from ipfs/fix/null-string
Browse files Browse the repository at this point in the history
Fix handling of null strings
  • Loading branch information
Lars Gierth committed Oct 3, 2018
2 parents c91f2b6 + 73bf6a7 commit 5969bcd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 5969bcd

Please sign in to comment.