diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionUiStateManager.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionUiStateManager.java
index 5e54cd2..a0f6b04 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionUiStateManager.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/appprediction/PredictionUiStateManager.java
@@ -52,7 +52,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Optional;
 import java.util.OptionalInt;
 import java.util.stream.IntStream;
 
@@ -315,16 +314,22 @@
      * {@link LauncherSettings.Favorites#ITEM_TYPE_DEEP_SHORTCUT}
      */
     public OptionalInt getAllAppsRank(@Nullable ItemInfo itemInfo) {
-        Optional<ComponentKey> componentKey = Optional.ofNullable(itemInfo)
-                .filter(item -> item.itemType == ITEM_TYPE_APPLICATION
-                        || item.itemType == ITEM_TYPE_SHORTCUT
-                        || item.itemType == ITEM_TYPE_DEEP_SHORTCUT)
-                .map(ItemInfo::getTargetComponent)
-                .map(componentName -> new ComponentKey(componentName, itemInfo.user));
+        if (itemInfo == null || itemInfo.getTargetComponent() == null || itemInfo.user == null) {
+            return OptionalInt.empty();
+        }
 
-        return componentKey.map(key -> IntStream.range(0, getCurrentState().apps.size())
-                .filter(index -> key.equals(getCurrentState().apps.get(index).getComponentKey()))
-                .findFirst()).orElseGet(OptionalInt::empty);
+        if (itemInfo.itemType == ITEM_TYPE_APPLICATION
+                || itemInfo.itemType == ITEM_TYPE_SHORTCUT
+                || itemInfo.itemType == ITEM_TYPE_DEEP_SHORTCUT) {
+            ComponentKey key = new ComponentKey(itemInfo.getTargetComponent(),
+                    itemInfo.user);
+            final List<ComponentKeyMapper> apps = getCurrentState().apps;
+            return IntStream.range(0, apps.size())
+                    .filter(index -> key.equals(apps.get(index).getComponentKey()))
+                    .findFirst();
+        }
+
+        return OptionalInt.empty();
     }
 
     /**
diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
index 1dbb9e2..987cd0f 100644
--- a/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
+++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java
@@ -655,11 +655,15 @@
                             + ",launchLocation:" + itemInfo.container);
         }
 
-        final ComponentKey k = new ComponentKey(itemInfo.getTargetComponent(), itemInfo.user);
+        if (itemInfo.getTargetComponent() == null || itemInfo.user == null) {
+            return;
+        }
+
+        final ComponentKey key = new ComponentKey(itemInfo.getTargetComponent(), itemInfo.user);
 
         final List<ComponentKeyMapper> predictedApps = new ArrayList<>(mComponentKeyMappers);
         OptionalInt rank = IntStream.range(0, predictedApps.size())
-                .filter((i) -> k.equals(predictedApps.get(i).getComponentKey()))
+                .filter(index -> key.equals(predictedApps.get(index).getComponentKey()))
                 .findFirst();
         if (!rank.isPresent()) {
             return;
