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
diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
index dde7d94..b021671 100644
--- a/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
+++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarActivityContext.java
@@ -876,7 +876,11 @@
* 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,