mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Random potential crash fixes
This commit is contained in:
parent
dbf96f68ff
commit
c9e22d898d
2 changed files with 2 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue