Fix crash when deleting last item in library (#6079)
(cherry picked from commit 3448751e0e2f1d96d547a019ce2d274c9be5a0e6)
This commit is contained in:
parent
a9a93e2f8f
commit
7e11f3952f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user