Merge "Check if mRecentsAnimationController is null before switching to screenshot" into sc-dev am: 5465527e16

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/14490316

Change-Id: Iee746fa8d5eb50fb660f95b49c6678197f72578a
diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java
index 5a58a82..4800596 100644
--- a/quickstep/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/src/com/android/quickstep/views/RecentsView.java
@@ -3635,6 +3635,12 @@
      * capturing the snapshot at the same time.
      */
     public void switchToScreenshot(Runnable onFinishRunnable) {
+        if (mRecentsAnimationController == null) {
+            if (onFinishRunnable != null) {
+                onFinishRunnable.run();
+            }
+            return;
+        }
         switchToScreenshot(mRunningTaskId == -1 ? null
                 : mRecentsAnimationController.screenshotTask(mRunningTaskId), onFinishRunnable);
     }