[develop]: HasDashboardGuard: Add stakeholder? to handle null values.
This commit is contained in:
parent
c762858427
commit
2c609d3bd0
|
@ -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}});
|
||||
|
|
Loading…
Reference in New Issue