Avoid crash in DeleteLibraryMangaDialog

No clue why it ever gets a -1 index though.
This commit is contained in:
arkon 2023-02-25 15:29:00 -05:00
parent 487622c592
commit b12c7cf963

View file

@ -64,10 +64,12 @@ fun DeleteLibraryMangaDialog(
list.forEach { state -> list.forEach { state ->
val onCheck = { val onCheck = {
val index = list.indexOf(state) val index = list.indexOf(state)
if (index != -1) {
val mutableList = list.toMutableList() val mutableList = list.toMutableList()
mutableList[index] = state.next() as CheckboxState.State<Int> mutableList[index] = state.next() as CheckboxState.State<Int>
list = mutableList.toList() list = mutableList.toList()
} }
}
Row( Row(
modifier = Modifier modifier = Modifier