Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #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 bf6985b + 37550be commit f8973f0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion 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 f8973f0

Please sign in to comment.