Skip to content

Commit

Permalink
fix issue 508 (json-iterator#512)
Browse files Browse the repository at this point in the history
  • Loading branch information
AllenX2018 authored Nov 14, 2020
2 parents adf50c0 + 75ce7fa commit 726ed9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion reflect.go
Original file line number Diff line number Diff line change
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 726ed9d

Please sign in to comment.