NPE with auth intent
We have seen few cases of app crashes due to NPE for authIntent object.
Please add a null check for this intent.
https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/AuthorizationManagementActivity.java#L218
Requesting team to label it as bug
Hi @hardikm9850,
not sure if this is related, but we had a similar kind of crash and fixed it by adding a try-catch for ActivityNotFoundException around startActivityForResult(authIntent, RC_AUTH). It's possible to have no suitable browser available for the intent (e.g. when all browsers are disabled or Opera is set as the default browser on some older versions of Android), in which case we then show a dialog to the user to get another browser...
Hi @hardikm9850, not sure if this is related, but we had a similar kind of crash and fixed it by adding a try-catch for
ActivityNotFoundExceptionaroundstartActivityForResult(authIntent, RC_AUTH). It's possible to have no suitable browser available for the intent (e.g. when all browsers are disabled or Opera is set as the default browser on some older versions of Android), in which case we then show a dialog to the user to get another browser...
I tried using Try-Catch, but getAuthorizationRequestIntent actually swallows the error, and I cannot access the exception, thus the app doesn't do anything at that point.
Do you have any further information on when these NPEs occur? I'm wondering if there is some general class of failure we are not handling correctly that deserves a more thorough fix than just a null check.
@iainmcgin Unfortunately, I got moved out of the project few months ago thus I cannot get more information related to this issue. @tobi512 I guess your fix would have solved our issue. we tried to reproduce it on different devices which had chrome browser. We should have tried with different browser.
@kiskunk Do you have any more information about this crash if you ever faced one?
@iainmcgin @agologan @chrismessina @hardikm9850 Do you have any updates on bug issue? or it's already been fixed in latest master branch.
Hey @knsjk1204 Thanks. The browser app check should avoid the crash. We can close the issue :)