Skip to content

Commit 59b34ad

Browse files
committed
Support decoding json strings containing null #225
1 parent 7e235e0 commit 59b34ad

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

encoding.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ func (c *Carbon) UnmarshalJSON(b []byte) error {
3333
if c.Error != nil {
3434
return c.Error
3535
}
36-
37-
if string(b) == "null" || len(b) == 0 {
36+
if len(b) == 0 || string(b) == "null" {
3837
return nil
3938
}
4039
key, value, tz := c.parseTag()

0 commit comments

Comments
 (0)