NavigationItemRenderer: Don't fail to render an icon if there's none

fixes #3859
This commit is contained in:
Johannes Meyer 2019-07-12 07:42:33 +02:00
parent fe3a51937a
commit b06103bfc5
1 changed files with 1 additions and 1 deletions

View File

@ -178,7 +178,7 @@ class NavigationItemRenderer
: $item->getLabel(); : $item->getLabel();
if (($icon = $item->getIcon()) !== null) { if (($icon = $item->getIcon()) !== null) {
$label = $this->view()->icon($icon) . $label; $label = $this->view()->icon($icon) . $label;
} else { } elseif ($item->getName()) {
$firstLetter = $item->getName()[0]; $firstLetter = $item->getName()[0];
$label = $this->view()->icon('letter', null, ['data-letter' => strtolower($firstLetter)]) . $label; $label = $this->view()->icon('letter', null, ['data-letter' => strtolower($firstLetter)]) . $label;
} }