Wesley Darnell
11/06/2023, 3:09 AMMutableState<List<Device>?>
inside a LazyColumn
. Device
is a custom data class. I am populating the LazyColumn
with a forEach
off my list. deviceList.value?.forEach {
I early return if my string search filter is not found. Then the error throws. Sometimes on seemingly random string searches.
Meat and potatoes of my filter
if (search.value.isNotEmpty()) {
if (!device.DeviceName.contains(
search.value,
ignoreCase = true
) && !device.Serial.contains(search.value, ignoreCase = true)
) {
return@forEach
}
}
item {
DeviceButton(navController, device, accountId)
}
I can't wrap my head around this error:
FATAL EXCEPTION: main
Process: com.wwdev.example.mobile, PID: 3504
java.lang.IndexOutOfBoundsException: Index 1, size 1
at androidx.compose.foundation.lazy.layout.MutableIntervalList.checkIndexBounds(IntervalList.kt:183)
Wesley Darnell
11/06/2023, 3:16 AMval deviceList = remember {mutableStateOf(deviceVM.devices.value)}
Wesley Darnell
11/06/2023, 3:27 AMZoltan Demant
11/06/2023, 4:33 AMWesley Darnell
11/06/2023, 4:57 AMWesley Darnell
11/06/2023, 5:04 AMvide
11/06/2023, 11:21 AMvide
11/06/2023, 11:22 AMvide
11/06/2023, 11:28 AM