You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I try to log in on a debug build variant via a Custom Tab, I get a NullPointerException that causes login to fail.
The NPE happens in LoginActivityIntent.getLoginMode because intent.getSerializableExtra(EXTRA_LOGIN_MODE) returns null and this value is then asserted to be not null.
I've narrowed it down to the following ProGuard rule:
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkNotNull(java.lang.Object);
# ...
}
When that rule is absent (e.g. in debug build variants), login doesn't work, but when that rule is present (e.g. in release build variants), then LoginActivityIntent.getLoginMode somehow just returns null and login via a Custom Tab works fine. Seems like the ProGuard rule is hiding the issue.
We could make the non-ProGuard behavior explicit by changing the implementation to
But I'm not familiar with the intent of the code that calls this function; maybe there's a mistake somewhere else that we should fix instead so that EXTRA_LOGIN_MODE will always be present.
Screenshots or video
The following is what I experience when I install and try to log in with the blueFdroidDebug build variant, built from the v2.5.1 source (i.e. commit c6d6f0f).
E FATAL EXCEPTION: main
Process: app.pachli, PID: 17131
java.lang.RuntimeException: Unable to start activity ComponentInfo{app.pachli/app.pachli.feature.login.LoginActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3946)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4126)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:108)
at android.app.servertransaction.TransactionExecutor.executeNonLifecycleItem(TransactionExecutor.java:195)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:157)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:90)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2544)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loopOnce(Looper.java:232)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8501)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)
Caused by: java.lang.NullPointerException
at app.pachli.core.navigation.LoginActivityIntent$Companion.getLoginMode(Navigation.kt:239)
at app.pachli.feature.login.LoginActivity.isAccountMigration(LoginActivity.kt:352)
at app.pachli.feature.login.LoginActivity.onCreate(LoginActivity.kt:98)
at android.app.Activity.performCreate(Activity.java:8767)
...
Affirmation
I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting.
The text was updated successfully, but these errors were encountered:
Describe the bug
When I try to log in on a debug build variant via a Custom Tab, I get a
NullPointerException
that causes login to fail.The NPE happens in
LoginActivityIntent.getLoginMode
becauseintent.getSerializableExtra(EXTRA_LOGIN_MODE)
returns null and this value is then asserted to be not null.I've narrowed it down to the following ProGuard rule:
When that rule is absent (e.g. in debug build variants), login doesn't work, but when that rule is present (e.g. in release build variants), then
LoginActivityIntent.getLoginMode
somehow just returns null and login via a Custom Tab works fine. Seems like the ProGuard rule is hiding the issue.We could make the non-ProGuard behavior explicit by changing the implementation to
But I'm not familiar with the intent of the code that calls this function; maybe there's a mistake somewhere else that we should fix instead so that
EXTRA_LOGIN_MODE
will always be present.Screenshots or video
The following is what I experience when I install and try to log in with the
blueFdroidDebug
build variant, built from the v2.5.1 source (i.e. commit c6d6f0f).login.issue.mp4
Versions
Pachli 2.5.1
Android 14
Server: 4.3.0-alpha.3+glitch
Additional context
Stack trace:
Affirmation
I have checked other issues for this project (open and closed) and I cannot find one that matches the problem I am reporting.
The text was updated successfully, but these errors were encountered: