SparkPost / gosparkpost

SparkPost client library for the Go Programming Language
https://www.sparkpost.com/
Other
62 stars 40 forks source link

HttpGetJson helper doesn't check nil before unmarshaling #124

Closed yargevad closed 6 years ago

yargevad commented 6 years ago

The basic unmarshaling done by HttpGetJson isn't sufficient in some cases (e.g. results wrapped in a dict with a results key). In this case, the third parameter may be nil. The nil check is however missing, which causes a JSON unmarshaling error.