mirror of
https://github.com/mihonapp/mihon.git
synced 2025-02-10 09:08:53 +01:00
Avoid crash in DeleteLibraryMangaDialog
No clue why it ever gets a -1 index though. (cherry picked from commit b12c7cf9633a9fc3a728a0ef44b5d50d621a7595)
This commit is contained in:
parent
08e6487a9a
commit
79323de326
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user