mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-11 14:43:13 +02:00
Random potential crash fixes
This commit is contained in:
parent
dbf96f68ff
commit
c9e22d898d
@ -73,7 +73,7 @@ class CategoryPresenter(
|
||||
val cat = Category.create(name)
|
||||
|
||||
// Set the new item in the last position.
|
||||
cat.order = categories.maxOf { it.order } + 1
|
||||
cat.order = (categories.maxOfOrNull { it.order } ?: 0) + 1
|
||||
|
||||
// Insert into database.
|
||||
cat.mangaSort = LibrarySort.Title.categoryValue
|
||||
|
@ -72,7 +72,7 @@ class LibraryCategoryAdapter(val controller: LibraryController) :
|
||||
fun findCategoryHeader(catId: Int): LibraryHeaderItem? {
|
||||
return currentItems.find {
|
||||
(it is LibraryHeaderItem) && it.category.id == catId
|
||||
} as LibraryHeaderItem
|
||||
} as? LibraryHeaderItem
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user