From d7335bdc2fa39cd30ead14da12f6ea4fd29b4b5d Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 25 May 2020 14:20:53 -0400 Subject: [PATCH] more tracepot crash fixes --- .../java/eu/kanade/tachiyomi/ui/library/LibraryController.kt | 4 ++-- .../java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt index e935205fc2..c6d6dd10ad 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryController.kt @@ -724,8 +724,8 @@ class LibraryController( if (justStarted && freshStart) { scrollToHeader(activeCategory) } - recycler.post { - elevateAppBar(recycler.canScrollVertically(-1)) + recycler?.post { + elevateAppBar(recycler?.canScrollVertically(-1) == true) setActiveCategory() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 4cf63bcc87..5bc4460098 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -158,7 +158,7 @@ class LibraryPresenter( private suspend fun sectionLibrary(items: List, freshStart: Boolean = false) { libraryItems = items val showAll = showAllCategories || !libraryIsGrouped || - categories.size == 1 + categories.size <= 1 if (!showAll) { sectionedLibraryItems = items.groupBy { it.header.category.id ?: 0 }.toMutableMap() if (currentCategory == -1) currentCategory = categories.find {