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

Commit 0008986e authored by Rubin Xu's avatar Rubin Xu
Browse files

Fix NPE in ChooseLockPattern

Since mChosenPattern can be null, guard against it.

Bug: 144452509
Test: manual
Change-Id: I2814e49ee2e63e19631e8415efcc50e9ae78d4fc
parent bfe25c3b
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -30,7 +30,6 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ScrollView;
import android.widget.TextView;

@@ -57,8 +56,6 @@ import com.google.android.setupcompat.template.FooterBarMixin;
import com.google.android.setupcompat.template.FooterButton;
import com.google.android.setupdesign.GlifLayout;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

@@ -608,8 +605,10 @@ public class ChooseLockPattern extends SettingsActivity {

        public void handleLeftButton() {
            if (mUiStage.leftMode == LeftButtonMode.Retry) {
                if (mChosenPattern != null) {
                    mChosenPattern.zeroize();
                    mChosenPattern = null;
                }
                mLockPatternView.clearPattern();
                updateStage(Stage.Introduction);
            } else {