stripe-ios
stripe-ios copied to clipboard
[BUG] stripeError not handled. SDK getting crash while making the payment using ApplePay
Summary
App getting crash while trying to make the Apple Pay. Screenshot [attached](url)
Code to reproduce
iOS version
15.0.1Installation method
Pod and swift package dependenceSDK version
Other information
Hello @Rthangavel, could you answer a few things for me to help debug?
- Can you print out the stripeError here (you can run the command
po stripeError
in the debugger)? - What Xcode version are you using?
- Do you have exception breakpoints enabled?
Hi Yuvi,
- strripeError -> nil
- Xcode version -> 13.3.1 (13E500a)
- Exception breakpoint not enabled.
On Fri, Jun 17, 2022 at 10:54 PM Yuki @.***> wrote:
Hello @Rthangavel https://github.com/Rthangavel, could you answer a few things for me to help debug?
- Can you print out the stripeError here (you can run the command po stripeError in the debugger)?
- What Xcode version are you using?
- Do you have exception breakpoints enabled?
— Reply to this email directly, view it on GitHub https://github.com/stripe/stripe-ios/issues/1979#issuecomment-1159091197, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSBO7IUKOUST7YRJNKEYALVPSYE3ANCNFSM5Y2YQU2A . You are receiving this because you were mentioned.Message ID: @.***>
Hi @Rthangavel:
It looks like you might be passing an NSError()
to Stripe's ApplePayContext completion handler. As pointed out in the console message, this isn't recommended, as it results in an invalid NSError object. (I realize we do this in some of our example apps — we should probably clean this up on our end as well!)
In your ApplePayDelegate, can you try replacing any usage of NSError()
with NSError(domain: "YourErrorDomain", code: 0, userInfo: nil)
? That should avoid this crash.
Thanks!