Fix crash resulting from missing entry in the taskViewIdArray

Bug: 338057269
Test: Manual
Flag: NA
Change-Id: Ifa99fe87423ba75f52c43248c8fd730667803d1a
This commit is contained in:
samcackett
2024-05-15 11:32:48 +01:00
parent fa09b12443
commit a24cb0e0fc
@@ -3887,7 +3887,8 @@ public abstract class RecentsView<CONTAINER_TYPE extends Context & RecentsViewCo
taskViewIdArray.removeValue(
finalNextFocusedTaskView.getTaskViewId());
}
if (snappedIndex < taskViewIdArray.size()) {
if (snappedIndex >= 0
&& snappedIndex < taskViewIdArray.size()) {
taskViewIdToSnapTo = taskViewIdArray.get(snappedIndex);
} else if (snappedIndex == taskViewIdArray.size()) {
// If the snapped task is the last item from the