From 2c609d3bd0bd65664b854641e3c0b7a421e16aba Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Mon, 23 Sep 2024 17:25:10 +0300 Subject: [PATCH] [develop]: HasDashboardGuard: Add stakeholder? to handle null values. --- monitor/services/hasDashboard.guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/services/hasDashboard.guard.ts b/monitor/services/hasDashboard.guard.ts index 6dfb950e..ce9f8984 100644 --- a/monitor/services/hasDashboard.guard.ts +++ b/monitor/services/hasDashboard.guard.ts @@ -17,7 +17,7 @@ export class HasDashboardGuard { check(path: string, alias: string, type: string, child: string): Observable | boolean { return (child?this.stakeholderService.getChildStakeholder(alias, type, child):this.stakeholderService.getStakeholder(alias)).pipe(take(1), map(stakeholder => { - return stakeholder.standalone || (!!stakeholder && !!child); + return stakeholder?.standalone || (!!stakeholder && !!child); }),tap(authorized => { if(!authorized){ this.router.navigate([LinksResolver.default.errorLink], {queryParams: {'page': path}});