From a47a8f1b1d824b4aee292621ea3b6e1b8ce4b6aa Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Tue, 26 May 2020 13:05:29 -0500 Subject: [PATCH] Fix NPE when recents animation controller is null If it's null, that means the animation was already canceled or finished, so we don't need to finish it anyway. Bug: 157383670 Change-Id: I9b0dde76d5756536d8d97bc3d7f13723f903a79c --- .../src/com/android/quickstep/BaseSwipeUpHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index d9574184f7..171ceb046f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -246,7 +246,9 @@ public abstract class BaseSwipeUpHandler, Q extend protected void onRestartLastAppearedTask() { // Finish the controller here, since we won't get onTaskAppeared() for a task that already // appeared. - mRecentsAnimationController.finish(false, null); + if (mRecentsAnimationController != null) { + mRecentsAnimationController.finish(false, null); + } } /**