Skip to content

Commit

Permalink
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 authored Oct 3, 2018
2 parents 11c8a5d + 4e145d8 commit 4a67b68
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 4a67b68

Please # to comment.