mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-04 08:08:55 +01:00 
			
		
		
		
	Fix crash when deleting last item in library (#6079)
This commit is contained in:
		@@ -139,9 +139,9 @@ class LibraryAdapter(
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    override fun getViewType(position: Int): Int {
 | 
			
		||||
        val category = categories[position]
 | 
			
		||||
        return if (isPerCategory && category.id != 0) {
 | 
			
		||||
            if (DisplayModeSetting.fromFlag(category.displayMode) == DisplayModeSetting.LIST) {
 | 
			
		||||
        val category = categories.getOrNull(position)
 | 
			
		||||
        return if (isPerCategory && category?.id != 0) {
 | 
			
		||||
            if (DisplayModeSetting.fromFlag(category?.displayMode) == DisplayModeSetting.LIST) {
 | 
			
		||||
                LIST_DISPLAY_MODE
 | 
			
		||||
            } else {
 | 
			
		||||
                GRID_DISPLAY_MODE
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user