From aa450618f8647a5c7595771cb101eb01f94b6e71 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Wed, 18 Oct 2023 08:15:01 +0200 Subject: [PATCH] Fix route state undefined (#2905) --- .../app/ui/modules/head-bar/services/routing-state.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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`]) {