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

Commit 6129e473 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix potential NPE in BackgroundAppState" into ub-launcher3-qt-dev

parents 1a66df25 f0d2e006
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -64,10 +64,12 @@ public class BackgroundAppState extends OverviewState {
    public ScaleAndTranslation getOverviewScaleAndTranslation(Launcher launcher) {
        // Initialize the recents view scale to what it would be when starting swipe up
        RecentsView recentsView = launcher.getOverviewPanel();
        if (recentsView.getTaskViewCount() == 0) {
        int taskCount = recentsView.getTaskViewCount();
        if (taskCount == 0) {
            return super.getOverviewScaleAndTranslation(launcher);
        }
        TaskView dummyTask = recentsView.getTaskViewAt(recentsView.getCurrentPage());
        TaskView dummyTask = recentsView.getTaskViewAt(Math.max(taskCount - 1,
                recentsView.getCurrentPage()));
        return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask)
                .getScaleAndTranslation();
    }