Skip to content

Commit

Permalink
fix issue 508 (#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenX2018 committed Nov 14, 2020
2 parents 6821bec + 1779031 commit 9b79a3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reflect.go
Expand Up @@ -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
}
Expand Down

0 comments on commit 9b79a3e

Please sign in to comment.