Commit ed3809b1 authored by Vincent Petry's avatar Vincent Petry Committed by GitHub

Merge pull request #27413 from owncloud/app-icon

Fix app icon detection code
parents 26d768b8 40633b0a
......@@ -153,23 +153,25 @@ class NavigationManager implements INavigationManager {
$route = $this->urlGenerator->linkToRoute($nav['route']);
$name = isset($nav['name']) ? $nav['name'] : ucfirst($app);
$icon = isset($nav['icon']) ? $nav['icon'] : 'app.svg';
$iconPath = null;
foreach ([$icon, "$app.svg"] as $i) {
try {
$icon = $this->urlGenerator->imagePath($app, $i);
$iconPath = $this->urlGenerator->imagePath($app, $i);
break;
} catch (\RuntimeException $ex) {
// no icon? - ignore it then
}
}
if (is_null($icon)) {
$icon = $this->urlGenerator->imagePath('core', 'default-app-icon');
if (is_null($iconPath)) {
$iconPath = $this->urlGenerator->imagePath('core', 'default-app-icon');
}
$this->add([
'id' => $app,
'order' => $order,
'href' => $route,
'icon' => $icon,
'icon' => $iconPath,
'name' => $l->t($name),
]);
}
......
......@@ -157,7 +157,7 @@ class URLGenerator implements IURLGenerator {
$path = $this->getImagePath($app, $image);
if($path !== '') {
if($path !== '' && !is_null($path)) {
$cache->set($cacheKey, $path);
return $path;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment