Skip to content

Entering a username with a space at the end crashes the app #627

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

Closed
VincentJoshuaET opened this issue May 19, 2021 · 2 comments · Fixed by #628
Closed

Entering a username with a space at the end crashes the app #627

VincentJoshuaET opened this issue May 19, 2021 · 2 comments · Fixed by #628

Comments

@VincentJoshuaET
Copy link
Contributor

Video:

Screen_Recording_20210519-131408_GeoViewer.Mobile.Debug.mp4

Error:

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.nobelsystems.geoviewermobile.debug, PID: 16395
    java.lang.RuntimeException: Could not dispatch event: class com.auth0.android.lock.events.DatabaseLoginEvent to handler [EventHandler public void com.auth0.android.lock.LockActivity.onDatabaseAuthenticationRequest(com.auth0.android.lock.events.DatabaseLoginEvent)]: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter usernameOrEmail
        at com.squareup.otto.Bus.throwRuntimeException(Bus.java:460)
        at com.squareup.otto.Bus.dispatch(Bus.java:387)
        at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:368)
        at com.squareup.otto.Bus.post(Bus.java:337)
        at com.auth0.android.lock.views.ClassicLockView.lambda$showContentLayout$2$ClassicLockView(ClassicLockView.java:138)
        at com.auth0.android.lock.views.-$$Lambda$ClassicLockView$dwMR8m5-c9nMTyChOWmZUT-whlA.onClick(Unknown Source:2)
        at android.view.View.performClick(View.java:8160)
        at android.view.View.performClickInternal(View.java:8137)
        at android.view.View.access$3700(View.java:888)
        at android.view.View$PerformClick.run(View.java:30236)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:246)
        at android.app.ActivityThread.main(ActivityThread.java:8512)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
     Caused by: java.lang.NullPointerException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkNotNullParameter, parameter usernameOrEmail
        at com.auth0.android.authentication.AuthenticationAPIClient.login(Unknown Source:3)
        at com.auth0.android.lock.LockActivity.onDatabaseAuthenticationRequest(LockActivity.java:408)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.squareup.otto.EventHandler.handleEvent(EventHandler.java:89)
        at com.squareup.otto.Bus.dispatch(Bus.java:385)
        at com.squareup.otto.Bus.dispatchQueuedEvents(Bus.java:368) 
        at com.squareup.otto.Bus.post(Bus.java:337) 
        at com.auth0.android.lock.views.ClassicLockView.lambda$showContentLayout$2$ClassicLockView(ClassicLockView.java:138) 
        at com.auth0.android.lock.views.-$$Lambda$ClassicLockView$dwMR8m5-c9nMTyChOWmZUT-whlA.onClick(Unknown Source:2) 
        at android.view.View.performClick(View.java:8160) 
        at android.view.View.performClickInternal(View.java:8137) 
        at android.view.View.access$3700(View.java:888) 
        at android.view.View$PerformClick.run(View.java:30236) 
        at android.os.Handler.handleCallback(Handler.java:938) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:246) 
        at android.app.ActivityThread.main(ActivityThread.java:8512) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) 
@lbalmaceda
Copy link
Contributor

I could reproduce. It seems that the cause is the regex checking logic here that doesn't accept whitespace. Anyway, I think it's safe to say both email and username inputs could be trimmed at the start/end of the string. Password is a special case as they should still accept whitespace anywhere.

I'll have a PR soon.

@lbalmaceda
Copy link
Contributor

@VincentJoshuaET Thanks for reporting this. I've just opened a PR that will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants