diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt index efb1972e62..fb2be954c6 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/MainActivity.kt @@ -642,7 +642,7 @@ open class MainActivity : BaseActivity(), DownloadServiceLi } override fun onBackPressed() { - val sheetController = router.backstack.last().controller as? BottomSheetController + val sheetController = router.backstack.lastOrNull()?.controller as? BottomSheetController if (if (router.backstackSize == 1) !(sheetController?.handleSheetBack() ?: false) else !router.handleBack() ) {