googlemaps / google-maps-services-go

Go client library for Google Maps API Web Services
https://pkg.go.dev/googlemaps.github.io/maps
Apache License 2.0
745 stars 215 forks source link

nil pointer dereference on failed binary request #250

Closed mgmcintyre closed 3 years ago

mgmcintyre commented 3 years ago

Environment details

  1. Places API / Place Photos
  2. macOS 10.15
  3. v1.2.3

Steps to reproduce

  1. Make an API which uses Client.getBinary, e.g. Client.PlacePhoto
  2. Have the request fail, e.g. through context cancellation
  3. See error panic: runtime error: invalid memory address or nil pointer dereference

Stack trace

googlemaps.github.io/maps.(*Client).getBinary(0xc000379b80, 0x183e340, 0xc000a76f00, 0x1cb5fe0, 0x182b1a0, 0xc0002e5100, 0x0, 0x0, 0x0, 0x0, ...)
    /Users/mgmcintyre/go/pkg/mod/googlemaps.github.io/maps@v1.2.3/client.go:312 +0x10c
googlemaps.github.io/maps.(*Client).PlacePhoto(0xc000379b80, 0x183e340, 0xc000a76f00, 0xc0002e5100, 0x0, 0x1, 0x4, 0x0, 0x0, 0x0)
    /Users/mgmcintyre/go/pkg/mod/googlemaps.github.io/maps@v1.2.3/places.go:814 +0x9c
googlemaps-bot commented 3 years ago

:tada: This issue has been resolved in version 1.3.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: