Skip to content

Commit

Permalink
fix unititialised IPNet marshalling
Browse files Browse the repository at this point in the history
  • Loading branch information
naggie committed Oct 26, 2020
1 parent 34ff77b commit b770d38
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion exttypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ func (n *JSONIPNet) UnmarshalJSON(b []byte) error {
}

func (n *JSONIPNet) String() string {
return n.IPNet.String()
if len(n.IPNet.IP) == 0 {
return "\"\""
} else {
return n.IPNet.String()
}
}

type JSONKey struct {
Expand Down

0 comments on commit b770d38

Please sign in to comment.