Skip to content

Commit

Permalink
Fix handling of null strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Gierth committed Oct 3, 2018
1 parent 11c8a5d commit 4e145d8
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 4e145d8

Please # to comment.