Skip to content

Commit 005d86d

Browse files
committed
fix handling of nil empty interface
1 parent e658f65 commit 005d86d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

feature_reflect_native.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ func (codec *emptyInterfaceCodec) EncodeInterface(val interface{}, stream *Strea
373373
}
374374

375375
func (codec *emptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
376-
return ptr == nil
376+
emptyInterface := (*emptyInterface)(ptr)
377+
return emptyInterface.typ == nil
377378
}
378379

379380
type nonEmptyInterfaceCodec struct {

0 commit comments

Comments
 (0)