diff --git a/client/src/app/ui/modules/head-bar/services/routing-state.service.ts b/client/src/app/ui/modules/head-bar/services/routing-state.service.ts index fa2d2c2136..81f1345b5b 100644 --- a/client/src/app/ui/modules/head-bar/services/routing-state.service.ts +++ b/client/src/app/ui/modules/head-bar/services/routing-state.service.ts @@ -63,7 +63,9 @@ export class RoutingStateService { pairwise() ) .subscribe((event: any[]) => { - this.skipUnsafeRouteCheck = router.getCurrentNavigation()?.extras?.state[`canGoBack`] ?? false; + this.skipUnsafeRouteCheck = + router.getCurrentNavigation()?.extras?.state && + router.getCurrentNavigation()?.extras?.state[`canGoBack`]; this._previousUrl = event[0]?.urlAfterRedirects ?? this._currentUrl; const currentNavigationExtras = router.getCurrentNavigation()?.extras; if (currentNavigationExtras && currentNavigationExtras.state && currentNavigationExtras.state[`back`]) {