mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-24 02:21:51 +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() {
|
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)
|
if (if (router.backstackSize == 1) !(sheetController?.handleSheetBack() ?: false)
|
||||||
else !router.handleBack()
|
else !router.handleBack()
|
||||||
) {
|
) {
|
||||||
|
Loading…
Reference in New Issue
Block a user