diff --git a/ui-ngx/src/app/core/services/menu.service.ts b/ui-ngx/src/app/core/services/menu.service.ts index 90976e282c..42668c7612 100644 --- a/ui-ngx/src/app/core/services/menu.service.ts +++ b/ui-ngx/src/app/core/services/menu.service.ts @@ -72,10 +72,12 @@ export class MenuService { private updateOpenedMenuSections() { const url = this.router.url; const openedMenuSections = getCurrentOpenedMenuSections(this.store); - this.currentMenuSections.filter(section => section.type === 'toggle' && - (url.startsWith(section.path) || openedMenuSections.includes(section.path))).forEach( - section => section.opened = true - ); + if (this.currentMenuSections?.length) { + this.currentMenuSections.filter(section => section.type === 'toggle' && + (url.startsWith(section.path) || openedMenuSections.includes(section.path))).forEach( + section => section.opened = true + ); + } } private allMenuLinks(sections: Array): Array {