Skip to content

Commit 7420887

Browse files
cxlblmmattn
authored andcommitted
fix Value null default
1 parent 23667d9 commit 7420887

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

time.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,8 @@ func (t *NullTime) UnmarshalJSON(data []byte) error {
8484

8585
// Value implement driver.Valuer.
8686
func (t NullTime) Value() (driver.Value, error) {
87+
if !t.Valid() {
88+
return nil, nil
89+
}
8790
return t.t, nil
8891
}

0 commit comments

Comments
 (0)