mirror of
https://github.com/json-iterator/go.git
synced 2025-02-01 19:14:29 +02:00
fix handling of nil empty interface
This commit is contained in:
parent
e658f6597a
commit
005d86dc44
@ -373,7 +373,8 @@ func (codec *emptyInterfaceCodec) EncodeInterface(val interface{}, stream *Strea
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (codec *emptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
|
func (codec *emptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
|
||||||
return ptr == nil
|
emptyInterface := (*emptyInterface)(ptr)
|
||||||
|
return emptyInterface.typ == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type nonEmptyInterfaceCodec struct {
|
type nonEmptyInterfaceCodec struct {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user