mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 04:09:18 +01:00
Using lastOrNull in mainactivity to prevent a crash
This commit is contained in:
parent
11467cdb01
commit
34fc0a662c
@ -642,7 +642,7 @@ open class MainActivity : BaseActivity<MainActivityBinding>(), 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()
|
||||
) {
|
||||
|
Loading…
Reference in New Issue
Block a user