From 26c893603f6356bba91f91a404899f1516469bd2 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Thu, 2 Mar 2023 17:45:01 -0800 Subject: [PATCH] Add null check for recents when tapping on Taskbar icons Fixes: 270669636 Test: Couldn't repro, but visually we have checks for recentsView != null && OTHER_CONDITION, but in the else case we don't check if recentsView being null is the reason the if-block didn't get triggered Change-Id: I72e7480bac56c7e7b7edb73edac4309e9923d302 --- .../android/launcher3/taskbar/TaskbarActivityContext.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java index dde7d94298..b021671a71 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java @@ -876,7 +876,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext { * as if the user tapped on it (preserving the split pair). Otherwise, launch it normally * (potentially breaking a split pair). */ - private void launchFromTaskbarPreservingSplitIfVisible(RecentsView recents, ItemInfo info) { + private void launchFromTaskbarPreservingSplitIfVisible(@Nullable RecentsView recents, + ItemInfo info) { + if (recents == null) { + return; + } ComponentKey componentToBeLaunched = new ComponentKey(info.getTargetComponent(), info.user); recents.getSplitSelectController().findLastActiveTaskAndRunCallback( componentToBeLaunched,