MaikuB / flutter_appauth

A Flutter wrapper for AppAuth iOS and Android SDKs
274 stars 246 forks source link

Add try catch to uncaught exception #553

Open john-slow opened 1 month ago

john-slow commented 1 month ago

As promised, I have created this pull request to address the bug where manually closing the login popup sheet could potentially trigger the following exception:

*** Terminating app due to uncaught exception 'An OAuth redirect was sent to a OIDExternalUserAgentSession after it already completed.', reason: 'An OAuth redirect was sent to a OIDExternalUserAgentSession after it already completed.'
*** First throw call stack:
(0x19f8a908c 0x19cbab2e4 0x19f9a4648 0x1027fe284 0x1037bf67c 0x10655f1a4 0x10652fe54 0x1031c95b0 0x1a3123f1c 0x1a312396c 0x1c2c5c248 0x1c2c2c68c 0x19f8460f4 0x19f845144 0x1038e671c 0x1038ea13c 0x1b8d5d3b8 0x1b8d5d338 0x1b8d5d210 0x19f87c088 0x19f87c01c 0x19f879b08 0x19f878d04 0x19f8785b8 0x1eb30e1c4 0x1a23ce2c0 0x1a247cddc 0x1a27a9b20 0x1032c47e8 0x1032c4760 0x1032c4864 0x1c504cd34)
libc++abi: terminating due to uncaught exception of type NSException