benjaminmayo / merchantkit

A modern In-App Purchases management framework for iOS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unwrapping optionals crash

vincentneo opened this issue · comments

MerchantKit/CommitPurchaseTask.swift:37: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value
2022-05-16 00:51:10.066444+0800 ColourConvert[7610:247789] MerchantKit/CommitPurchaseTask.swift:37: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Crashed happened at line 37 ( self.onCompletion(result)).

Replicate:

  1. Start a commitPurchaseTask on merchant.
  2. Sandbox payment made using an Apple ID without permissions to make in app purchases. (refer to screenshot)
  3. Press ok on step 2's popup.
  4. Observe crash.

Screenshot 2022-05-16 at 12 55 16 AM

While I could have done something wrong on my end, it looks more like a bug to me (probably some edge case situation that happens where account cannot buy IAPs). Feels worthy to report, even if it likely won't happen in production. Please advise if you believe it's a problem on my end.

Target Platform: macOS
Version of MerchantKit: master branch via SPM

Just realised it's my fault for not reading the README properly. Sorry!