libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 82 forks source link

iOS: don't throw NPE when product is not found #55

Closed xoppa closed 9 years ago

xoppa commented 9 years ago

On iOS the getProductByStoreIdentifier can return null in case the product is not found. The rest of the code assumes it is not null though, which can result in an NPE. This PR fixes this by simply ignoring the transaction when the product is not known.

A simple way to reproduce it would be:

This is not a very likely real world production use-case, but a very common use-case when developing/testing. Therefor I think that simply ignoring the transaction (while logging a message) should be enough.

noblemaster commented 9 years ago

Looks good! Thanks :)