Explorar el Código

fix issue 508

fishyww hace 5 años
padre
commit
1779031cda
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      reflect.go

+ 1 - 1
reflect.go

@@ -65,7 +65,7 @@ func (iter *Iterator) ReadVal(obj interface{}) {
 	decoder := iter.cfg.getDecoderFromCache(cacheKey)
 	if decoder == nil {
 		typ := reflect2.TypeOf(obj)
-		if typ.Kind() != reflect.Ptr {
+		if typ == nil || typ.Kind() != reflect.Ptr {
 			iter.ReportError("ReadVal", "can only unmarshal into pointer")
 			return
 		}