From b7188ecf3b0e8a020f47517bd386a4ab2c0dfbe9 Mon Sep 17 00:00:00 2001 From: Bastian Rihm Date: Tue, 17 Oct 2023 17:44:18 +0200 Subject: [PATCH] Fix route state undefined --- .../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`]) {