Fix IndexOutOfBoundsException

Test: none, MonkeyComboTest_StabilityMonkey
Fixes: 341614935
Flag: EXEMPT bugfix
Change-Id: Id52bcbc40145d7dca477425322e317abc2268a59
This commit is contained in:
Julia Reynolds
2024-07-03 09:32:59 -04:00
parent 0037dfe9a9
commit bb10c9f4df

View File

@@ -105,7 +105,7 @@ class AppNotificationsListModel(
override fun getSpinnerOptions(recordList: List<AppNotificationsRecord>): List<SpinnerOption> {
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)
}