Null check during filtering itemInfo by itemType.

Java crash says theres NPE on an itemType on null object reference implying itemInfo is null.

bug: 416662647
Test: presubmit
Flag: EXEMPT crash fix
Change-Id: I3c9724964442435148a720e96f208bd7c2a19ad5
This commit is contained in:
Brandon Dayauon
2025-05-12 10:09:20 -07:00
parent ab84f60449
commit bfa3f776fd
@@ -72,7 +72,8 @@ public class PredictionUpdateTask implements ModelUpdateTask {
Set<UserHandle> usersForChangedShortcuts =
dataModel.itemsIdMap.getPredictedContents(mPredictorState.containerId).stream()
.filter(info -> info.itemType == ITEM_TYPE_DEEP_SHORTCUT)
.filter(info -> info != null &&
info.itemType == ITEM_TYPE_DEEP_SHORTCUT)
.map(info -> info.user)
.collect(Collectors.toSet());