Преглед на файлове

fix handling of nil empty interface

Jason Toffaletti преди 8 години
родител
ревизия
005d86dc44
променени са 1 файла, в които са добавени 2 реда и са изтрити 1 реда
  1. 2 1
      feature_reflect_native.go

+ 2 - 1
feature_reflect_native.go

@@ -373,7 +373,8 @@ func (codec *emptyInterfaceCodec) EncodeInterface(val interface{}, stream *Strea
 }
 
 func (codec *emptyInterfaceCodec) IsEmpty(ptr unsafe.Pointer) bool {
-	return ptr == nil
+	emptyInterface := (*emptyInterface)(ptr)
+	return emptyInterface.typ == nil
 }
 
 type nonEmptyInterfaceCodec struct {