diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index 8cb542c5ea..1ef4039ce9 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -518,20 +518,22 @@ public abstract class AbsSwipeUpHandler, // Set up a entire animation lifecycle callback to notify the current recents view when // the animation is canceled mGestureState.runOnceAtState(STATE_RECENTS_ANIMATION_CANCELED, () -> { - HashMap snapshots = - mGestureState.consumeRecentsAnimationCanceledSnapshot(); - if (snapshots != null) { - mRecentsView.switchToScreenshot(snapshots, () -> { - if (mRecentsAnimationController != null) { - mRecentsAnimationController.cleanupScreenshot(); - } else if (mDeferredCleanupRecentsAnimationController != null) { - mDeferredCleanupRecentsAnimationController.cleanupScreenshot(); - mDeferredCleanupRecentsAnimationController = null; - } - }); - mRecentsView.onRecentsAnimationComplete(); - } - }); + if (mRecentsView == null) return; + + HashMap snapshots = + mGestureState.consumeRecentsAnimationCanceledSnapshot(); + if (snapshots != null) { + mRecentsView.switchToScreenshot(snapshots, () -> { + if (mRecentsAnimationController != null) { + mRecentsAnimationController.cleanupScreenshot(); + } else if (mDeferredCleanupRecentsAnimationController != null) { + mDeferredCleanupRecentsAnimationController.cleanupScreenshot(); + mDeferredCleanupRecentsAnimationController = null; + } + }); + mRecentsView.onRecentsAnimationComplete(); + } + }); setupRecentsViewUi(); mRecentsView.runOnPageScrollsInitialized(this::linkRecentsViewScroll);