android: only navigate to main if navController is initialized

Updates #cleanup

Signed-off-by: Percy Wegmann <percy@tailscale.com>
(cherry picked from commit 698fb868a7)
release-branch/1.66
Percy Wegmann 2 years ago committed by Andrea Gottardo
parent 5860601c6d
commit 01d939d0c7

@ -265,7 +265,9 @@ class MainActivity : ComponentActivity() {
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
if (intent?.getBooleanExtra(START_AT_ROOT, false) == true) {
navController.popBackStack(route = "main", inclusive = false)
if (this::navController.isInitialized) {
navController.popBackStack(route = "main", inclusive = false)
}
}
}

Loading…
Cancel
Save