Selaa lähdekoodia

fix issue 508

fishyww 5 vuotta sitten
vanhempi
commit
1779031cda
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  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
 		}