Explorar o código

fix issue 508

fishyww %!s(int64=5) %!d(string=hai) anos
pai
achega
1779031cda
Modificáronse 1 ficheiros con 1 adicións e 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
 		}