mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-05 08:38:56 +01:00
Avoid some IndexOutOfBoundsExceptions
This commit is contained in:
@@ -93,10 +93,12 @@ fun ChangeCategoryDialog(
|
||||
selection.forEach { checkbox ->
|
||||
val onChange: (CheckboxState<Category>) -> Unit = {
|
||||
val index = selection.indexOf(it)
|
||||
val mutableList = selection.toMutableList()
|
||||
mutableList.removeAt(index)
|
||||
mutableList.add(index, it.next())
|
||||
selection = mutableList.toList()
|
||||
if (index != -1) {
|
||||
val mutableList = selection.toMutableList()
|
||||
mutableList.removeAt(index)
|
||||
mutableList.add(index, it.next())
|
||||
selection = mutableList.toList()
|
||||
}
|
||||
}
|
||||
Row(
|
||||
modifier = Modifier
|
||||
|
||||
Reference in New Issue
Block a user