Fix NPE when there's no forgot password button.

Test: manual
Bug: 149887743
Change-Id: If2238aec2e618f617b7459b819303c03f009941a
This commit is contained in:
Pavel Grafov
2020-02-20 12:32:57 +00:00
parent 3c96925aef
commit c4d9980a5d
7 changed files with 30 additions and 14 deletions

View File

@@ -240,7 +240,9 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
super.prepareEnterAnimation();
mHeaderTextView.setAlpha(0f);
mCancelButton.setAlpha(0f);
mForgotButton.setAlpha(0f);
if (mForgotButton != null) {
mForgotButton.setAlpha(0f);
}
mLockPatternView.setAlpha(0f);
mDetailsTextView.setAlpha(0f);
}
@@ -268,7 +270,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
if (mCancelButton.getVisibility() == View.VISIBLE) {
result.add(new ArrayList<>(Collections.singletonList(mCancelButton)));
}
if (mForgotButton.getVisibility() == View.VISIBLE) {
if (mForgotButton != null) {
result.add(new ArrayList<>(Collections.singletonList(mForgotButton)));
}
LockPatternView.CellState[][] cellStates = mLockPatternView.getCellStates();