saturngod / IAPHelper

No more maintenance for this repo. Please use the https://github.com/bizz84/SwiftyStoreKit
MIT License
1.55k stars 280 forks source link

fix: in case of a missing original transaction the restore function crashed #11

Closed davidkovaccs closed 10 years ago

davidkovaccs commented 10 years ago

In my case (maybe because of the lots of auto renewable subscriptions I've generated through testing) there were a few cases where on restore the transction's originalTransaction was nil and it crashed when it tried to add a nil product identifier to an NSSet. I've fixed this issue by using the restored transaction's product identifier instead of the original transaction. I'm not 100% sure that this is the best way to solve this issue but it solved it permanently.