diff --git a/interoperability/ocss/time.go b/interoperability/ocss/time.go index 7cb077f..ac6ca53 100644 --- a/interoperability/ocss/time.go +++ b/interoperability/ocss/time.go @@ -22,9 +22,12 @@ func (v OCSSTime) MarshalBSONValue() (bsontype.Type, []byte, error) { return bson.MarshalValue(time.Time(v)) } -func (t OCSSTime) ToTime() time.Time { - time := time.Time(t) - return time +func (t *OCSSTime) ToTime() *time.Time { + if t == nil { + return nil + } + time := time.Time(*t) + return &time } func (t *OCSSTime) UnmarshalJSON(b []byte) error {