From cb9ae18226fb768200e65e1230fb0fa435f0a532 Mon Sep 17 00:00:00 2001 From: Winson Chung Date: Mon, 19 Mar 2018 16:20:38 -0700 Subject: [PATCH] Skip launching task if there is no task Bug: 75974298 Change-Id: I60a6c27c4dfb983d0f6e9832fb3be1e714cea2e7 --- .../src/com/android/quickstep/QuickScrubController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/QuickScrubController.java b/quickstep/src/com/android/quickstep/QuickScrubController.java index a154b291e2..d263fbfc6d 100644 --- a/quickstep/src/com/android/quickstep/QuickScrubController.java +++ b/quickstep/src/com/android/quickstep/QuickScrubController.java @@ -84,7 +84,10 @@ public class QuickScrubController implements OnAlarmListener { } int page = mRecentsView.getNextPage(); Runnable launchTaskRunnable = () -> { - ((TaskView) mRecentsView.getPageAt(page)).launchTask(true); + TaskView taskView = ((TaskView) mRecentsView.getPageAt(page)); + if (taskView != null) { + taskView.launchTask(true); + } }; int snapDuration = Math.abs(page - mRecentsView.getPageNearestToCenterOfScreen()) * QUICKSCRUB_END_SNAP_DURATION_PER_PAGE;