[develop]: HasDashboardGuard: Add stakeholder? to handle null values.

This commit is contained in:
Konstantinos Triantafyllou 2024-09-23 17:25:10 +03:00
parent c762858427
commit 2c609d3bd0
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ export class HasDashboardGuard {
check(path: string, alias: string, type: string, child: string): Observable<boolean> | 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}});