N°4751 - Fix crash when disabling newsroom in configuration

This commit is contained in:
Molkobain
2022-02-04 22:58:48 +01:00
parent e3bce622e5
commit af5a0d5006

View File

@@ -253,7 +253,15 @@ class NavigationMenu extends UIBlock implements iKeyboardShortcut
*/
public function GetSubBlocks(): array
{
return [$this->oUserMenu->GetId() => $this->oUserMenu, $this->GetNewsroomMenu()->GetId() => $this->GetNewsroomMenu()];
$aSubBlocks = [
$this->oUserMenu->GetId() => $this->oUserMenu,
];
if ($this->IsNewsroomEnabled()) {
$aSubBlocks[$this->GetNewsroomMenu()->GetId()] = $this->GetNewsroomMenu();
}
return $aSubBlocks;
}
/**