Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE when resuming AuthenticationActivity #119

Closed
twaddington opened this issue Sep 29, 2017 · 4 comments
Closed

NPE when resuming AuthenticationActivity #119

twaddington opened this issue Sep 29, 2017 · 4 comments
Labels
bug This points to a verified bug in the code

Comments

@twaddington
Copy link

Has anyone else encountered this error?

After calling WebAuthProvider.init(auth0)...start() to display the chrome tab view simply tapping "Back" or the "Close" button results in a crash:

09-29 14:41:39.355 11231 11231 E AndroidRuntime: java.lang.RuntimeException: Unable to resume activity {com.dat.template/com.auth0.android.provider.AuthenticationActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3645)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3685)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1643)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:105)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6541)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String[] java.lang.String.split(java.lang.String)' on a null object reference
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.jwt.JWT.splitToken(JWT.java:209)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.jwt.JWT.decode(JWT.java:200)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.jwt.JWT.<init>(JWT.java:40)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.provider.OAuthManager.assertValidNonce(OAuthManager.java:186)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.provider.OAuthManager.resumeAuthorization(OAuthManager.java:116)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.provider.WebAuthProvider.resume(WebAuthProvider.java:361)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.provider.AuthenticationActivity.deliverSuccessfulAuthenticationResult(AuthenticationActivity.java:117)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at com.auth0.android.provider.AuthenticationActivity.onResume(AuthenticationActivity.java:78)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1354)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.Activity.performResume(Activity.java:7079)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3620)
09-29 14:41:39.355 11231 11231 E AndroidRuntime: 	... 8 more
@twaddington
Copy link
Author

This looks like a problem with the logic in AuthenticationActivity#onResume.

@lbalmaceda
Copy link
Contributor

I could reproduce it by asking for response_type=code+id_token. I'll look into it. Thanks

@lbalmaceda lbalmaceda added the bug This points to a verified bug in the code label Oct 1, 2017
@twaddington
Copy link
Author

I could reproduce it by asking for response_type=code+id_token. I'll look into it. Thanks — @lbalmaceda

Awesome, thanks!

@lbalmaceda
Copy link
Contributor

This should be fixed in the latest patch. Please try 1.10.1 and reopen if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This points to a verified bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants