Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8b2baed2 authored by Fan Zhang's avatar Fan Zhang
Browse files

Fix a NPE in confirm lock screen.

The NPE happens is when using pin later. It's too late to recover if we
just catch the NPE where it happens, so we should early terminate the
call by adding TextUtil.isEmpty(pin) check.

Change-Id: Id280cd1b8781678540c9ea281b3186edd04d61f9
Fixes: 31895774
Test: make RunSettingsRoboTests
Test: manually enter correct/wrong/empty password/pin in confirm lock UI
(cherry picked from commit 774e1d84)
parent 6cab381b
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -320,11 +320,15 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
                return;
            }

            mPasswordEntryInputDisabler.setInputEnabled(false);

            final String pin = mPasswordEntry.getText().toString();
            if (TextUtils.isEmpty(pin)) {
                return;
            }

            mPasswordEntryInputDisabler.setInputEnabled(false);
            final boolean verifyChallenge = getActivity().getIntent().getBooleanExtra(
                    ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, false);

            Intent intent = new Intent();
            if (verifyChallenge)  {
                if (isInternalActivity()) {