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

NullPointerException when errorDescription is null #662

Closed
6 tasks done
Fraid opened this issue Jun 14, 2023 · 1 comment
Closed
6 tasks done

NullPointerException when errorDescription is null #662

Fraid opened this issue Jun 14, 2023 · 1 comment
Labels
bug This points to a verified bug in the code

Comments

@Fraid
Copy link

Fraid commented Jun 14, 2023

Checklist

Description

Auth0 will send an unauthorized error but the errorDescription will be null causing a NullPointerException inside of the expected AuthenticationException.
throw AuthenticationException(ERROR_VALUE_UNAUTHORIZED, errorDescription!!)

I look in the code and it's null because:
CallbackHelper.asMap testing for value==2 but for errorDescription it's value==3
"error_description=Please verify your email before logging in.e=[email protected]"
So the key "error_description" is never set and then "OAuthManager.assertNoError" will crash with a NullPointerException.

Original app trace:
java.lang.RuntimeException: Unable to resume activity {com.MY_PACKAGE.app/com.auth0.android.provider.AuthenticationActivity}: java.lang.NullPointerException at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4770) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4803) at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:179) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7884) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) Caused by: java.lang.NullPointerException at com.auth0.android.provider.OAuthManager.assertNoError(OAuthManager.kt:203) at com.auth0.android.provider.OAuthManager.resume(OAuthManager.kt:95) at com.auth0.android.provider.WebAuthProvider.resume(WebAuthProvider.kt:77) at com.auth0.android.provider.AuthenticationActivity.deliverAuthenticationResult$auth0_release(AuthenticationActivity.kt:86) at com.auth0.android.provider.AuthenticationActivity.onResume(AuthenticationActivity.kt:54) at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1564) at android.app.Activity.performResume(Activity.java:8473) at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4760) at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4803)  at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:57)  at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)  at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:179)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2303)  at android.os.Handler.dispatchMessage(Handler.java:106)  at android.os.Looper.loopOnce(Looper.java:201)  at android.os.Looper.loop(Looper.java:288)  at android.app.ActivityThread.main(ActivityThread.java:7884)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936) 

Reproduction

1- Sign up with a new account without validating the email (ex. [email protected]).
2- Close the app then try to login with the unvalidated email

Additional context

No response

Auth0.Android version

2.9.3

Android version(s)

13

@Fraid Fraid added the bug This points to a verified bug in the code label Jun 14, 2023
@poovamraj
Copy link
Contributor

@Fraid we have a PR to fix this here - #667

We can continue the conversation there. We will close this issue for now. Please let us know your feedback in the PR.

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