Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 31e9ca61 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Fix NPE if display is off and then removed

The additional display can be removed right after turning off.

Bug: 185460118
Test: Toggle display
Change-Id: I25d86e952f5e24f3165ce556b6435ba61b59f596
parent e356c06b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -646,8 +646,12 @@ class TaskSnapshotController {
        if (shouldDisableSnapshots()) {
            return;
        }
        final DisplayContent displayContent = mService.mRoot.getDisplayContent(displayId);
        if (displayContent == null) {
            return;
        }
        mTmpTasks.clear();
        mService.mRoot.getDisplayContent(displayId).forAllTasks(task -> {
        displayContent.forAllTasks(task -> {
            // Since RecentsAnimation will handle task snapshot while switching apps with the best
            // capture timing (e.g. IME window capture), No need additional task capture while task
            // is controlled by RecentsAnimation.