Skip to content

Commit cc9ada3

Browse files
skriptblepaynechu
andauthored
Update bson/bsoncodec/struct_codec.go
Co-Authored-By: paynechu <[email protected]>
1 parent 87dcbcf commit cc9ada3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bson/bsoncodec/struct_codec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ func (sc *StructCodec) isZero(i interface{}) bool {
235235
return true
236236
}
237237

238-
if z, ok := v.Interface().(Zeroer); ok {
238+
if z, ok := v.Interface().(Zeroer); ok && (v.Kind() != reflect.Ptr || !v.IsNil()) {
239239
return z.IsZero()
240240
}
241241

0 commit comments

Comments
 (0)