N°5343 - Avoid crash when 1 level menu group is not actually a MenuGroup (#312)

This commit is contained in:
Molkobain
2022-08-09 17:45:31 +02:00
committed by GitHub
parent 69749a5cbe
commit e44523e623

View File

@@ -265,6 +265,14 @@ class ApplicationMenu
/** @var \MenuGroup $oMenuNode */
$oMenuNode = static::GetMenuNode($sMenuGroupIdx);
if (!($oMenuNode instanceof MenuGroup)) {
IssueLog::Error('Menu node was not displayed as a menu group as it is actually not a menu group', LogChannels::CONSOLE, [
'menu_node_class' => get_class($oMenuNode),
'menu_node_label' => $oMenuNode->GetLabel(),
]);
continue;
}
$aMenuGroups[] = [
'sId' => $oMenuNode->GetMenuID(),
'sIconCssClasses' => $oMenuNode->GetDecorationClasses(),