Don't set enabled on TaskMenu view if shortcut not available
Bug: 188195640
Test: No crash when opening tasks when SPLIT_SELECT flag on.
Change-Id: I8f27e311cbb03ea37dcbd63d209b6652f02074af
diff --git a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
index c06e9a9..4ec1c15 100644
--- a/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
+++ b/quickstep/src/com/android/quickstep/TaskShortcutFactory.java
@@ -231,7 +231,7 @@
@Override
public SystemShortcut getShortcut(BaseDraggingActivity activity, TaskView taskView) {
SystemShortcut shortcut = super.getShortcut(activity, taskView);
- if (FeatureFlags.ENABLE_SPLIT_SELECT.get()) {
+ if (shortcut != null && FeatureFlags.ENABLE_SPLIT_SELECT.get()) {
// Disable if there's only one recent app for split screen
shortcut.setEnabled(taskView.getRecentsView().getTaskViewCount() > 1);
}