mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Avoid crash in DeleteLibraryMangaDialog
No clue why it ever gets a -1 index though.
(cherry picked from commit b12c7cf963)
			
			
This commit is contained in:
		@@ -64,9 +64,11 @@ fun DeleteLibraryMangaDialog(
 | 
			
		||||
                list.forEach { state ->
 | 
			
		||||
                    val onCheck = {
 | 
			
		||||
                        val index = list.indexOf(state)
 | 
			
		||||
                        val mutableList = list.toMutableList()
 | 
			
		||||
                        mutableList[index] = state.next() as CheckboxState.State<Int>
 | 
			
		||||
                        list = mutableList.toList()
 | 
			
		||||
                        if (index != -1) {
 | 
			
		||||
                            val mutableList = list.toMutableList()
 | 
			
		||||
                            mutableList[index] = state.next() as CheckboxState.State<Int>
 | 
			
		||||
                            list = mutableList.toList()
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    Row(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user