瀏覽代碼

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 {