From 8791b72cb1ebdd4b803bbd7d7828630f82fe8a9f Mon Sep 17 00:00:00 2001 From: jmir1 <43830312+jmir1@users.noreply.github.com> Date: Wed, 9 Jun 2021 23:15:48 +0200 Subject: [PATCH] Fix library settings sheet causing app to crash... (#5354) ...when the category list is empty --- .../eu/kanade/tachiyomi/ui/library/LibraryController.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 409c738f36..fe0d33185b 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 @@ -262,8 +262,12 @@ class LibraryController( } fun showSettingsSheet() { - adapter?.categories?.get(binding.libraryPager.currentItem)?.let { category -> - settingsSheet?.show(category) + if (adapter?.categories?.isNotEmpty() == true) { + adapter?.categories?.get(binding.libraryPager.currentItem)?.let { category -> + settingsSheet?.show(category) + } + } else { + settingsSheet?.show() } }