fix issue 508

This commit is contained in:
fishyww committed 2020-11-13 15:58:42 +08:00
1 parent 6821bec9fa
commit 1779031cda
1 file changed
+1 -1
+1 -1
View File
@@ -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
}