From bb10c9f4df28d242c2de888b62448d5efcbfa8c9 Mon Sep 17 00:00:00 2001 From: Julia Reynolds Date: Wed, 3 Jul 2024 09:32:59 -0400 Subject: [PATCH] Fix IndexOutOfBoundsException Test: none, MonkeyComboTest_StabilityMonkey Fixes: 341614935 Flag: EXEMPT bugfix Change-Id: Id52bcbc40145d7dca477425322e317abc2268a59 --- .../settings/spa/notification/AppNotificationsListModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/com/android/settings/spa/notification/AppNotificationsListModel.kt b/src/com/android/settings/spa/notification/AppNotificationsListModel.kt index 9f949c43ba2..8a534c8b14d 100644 --- a/src/com/android/settings/spa/notification/AppNotificationsListModel.kt +++ b/src/com/android/settings/spa/notification/AppNotificationsListModel.kt @@ -105,7 +105,7 @@ class AppNotificationsListModel( override fun getSpinnerOptions(recordList: List): List { val options = mutableListOf(SpinnerItem.AllApps, SpinnerItem.TurnedOff) - if (repository.isUserUnlocked(recordList[0].app.userId)) { + if (recordList.isNotEmpty() && repository.isUserUnlocked(recordList[0].app.userId)) { options.add(0, SpinnerItem.MostRecent) options.add(1, SpinnerItem.MostFrequent) }