diff --git a/rfctime/rfc3339Nano.go b/rfctime/rfc3339Nano.go index f8df4c7..6bc9256 100644 --- a/rfctime/rfc3339Nano.go +++ b/rfctime/rfc3339Nano.go @@ -115,7 +115,11 @@ func (t RFC3339NanoTime) DecodeValue(dc bsoncodec.DecodeContext, vr bsonrw.Value return err } - val.Set(reflect.ValueOf(t)) + if val.Kind() == reflect.Ptr { + val.Set(reflect.ValueOf(&t)) + } else { + val.Set(reflect.ValueOf(t)) + } return nil }