Skip to content

Commit da27a86

Browse files
author
Aleksander Korelskiy
committed
nil timestamp conversion fix
1 parent 3095c08 commit da27a86

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/go/time.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ func TimeToProto(t time.Time) (*timestamp.Timestamp, error) {
2020
}
2121

2222
func ProtoToTime(t *timestamp.Timestamp) (time.Time, error) {
23+
if t == nil {
24+
return time.Time{}, nil
25+
}
2326
return ptypes.Timestamp(t)
2427
}
2528

0 commit comments

Comments
 (0)