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

Commit d359dcd5 authored by kaiyiz's avatar kaiyiz Committed by Linux Build Service Account
Browse files

Keyguard: Fix crash in widget pager

Systemui crashed during automatic test, due to NPE of currentPage.

Add null protect for currentPage view.

CRs-Fixed: 715102

Change-Id: Ia1ac67a28fc3aeca6395200adc3448923775164f
parent 2d01654f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -818,6 +818,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
            mZoomInOutAnim.cancel();
        }
        final View currentPage = getPageAt(getCurrentPage());
        if (currentPage == null) return;
        if (currentPage.getScaleX() < 1f || currentPage.getScaleY() < 1f) {
            mZoomInOutAnim = new AnimatorSet();
            mZoomInOutAnim.playTogether(
@@ -839,6 +840,7 @@ public class KeyguardWidgetPager extends PagedView implements PagedView.PageSwit
        }
        int curPage = getCurrentPage();
        View currentPage = getPageAt(curPage);
        if (currentPage == null) return;
        if (shouldSetTopAlignedPivotForWidget(curPage)) {
            currentPage.setPivotY(0);
            // Note: we are working around the issue that setting the x-pivot to the same value as it