From 8f144316a6f92dd067b7c0313cfc43cc4b02551d Mon Sep 17 00:00:00 2001 From: len Date: Fri, 6 May 2016 15:44:01 +0200 Subject: [PATCH] Fix a crash when updating active category and no categories available --- .../java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt index 0dc7a3f04..9a4699926 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryFragment.kt @@ -204,8 +204,9 @@ class LibraryFragment : BaseRxFragment(), ActionMode.Callback LibraryUpdateService.start(activity, true) } R.id.action_update_category -> { - val category = presenter.categories[view_pager.currentItem] - LibraryUpdateService.start(activity, true, category) + presenter.categories.getOrNull(view_pager.currentItem)?.let { + LibraryUpdateService.start(activity, true, it) + } } R.id.action_edit_categories -> { val intent = CategoryActivity.newIntent(activity)