Fix NPE from accessing pausing tasks

- It's possible for mPausingTasks to be unset between
  startRecentsTransition() and startAnimation(), and in these cases
  canceling with a screenshot can not take the snapshots as we have no
  leashes of the tasks in the animation itself.  For now, just cancel
  the transition without the snapshots.

Fixes: 286874048
Test: Just adding an NPE check
Change-Id: Ie1315d8f6451cfb9b2ee2782c7d89db3cbb36aac
This commit is contained in:
Winson Chung
2023-06-12 23:49:30 +00:00
parent 0404e1bced
commit a554a02f30

View File

@@ -313,7 +313,7 @@ public class RecentsTransitionHandler implements Transitions.TransitionHandler {
private Pair<int[], TaskSnapshot[]> getSnapshotsForPausingTasks() {
int[] taskIds = null;
TaskSnapshot[] snapshots = null;
if (mPausingTasks.size() > 0) {
if (mPausingTasks != null && mPausingTasks.size() > 0) {
taskIds = new int[mPausingTasks.size()];
snapshots = new TaskSnapshot[mPausingTasks.size()];
try {