Merge pull request #2588 from nextcloud/theming-check-empty
Check if image files for theming are empty
This commit is contained in:
commit
d10be51d40
|
@ -94,6 +94,9 @@ class IconController extends Controller {
|
||||||
$iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image));
|
$iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image));
|
||||||
} catch (NotFoundException $exception) {
|
} catch (NotFoundException $exception) {
|
||||||
$icon = $this->iconBuilder->colorSvg($app, $image);
|
$icon = $this->iconBuilder->colorSvg($app, $image);
|
||||||
|
if ($icon === false || $icon === "") {
|
||||||
|
return new NotFoundResponse();
|
||||||
|
}
|
||||||
$iconFile = $this->imageManager->setCachedImage("icon-" . $app . '-' . str_replace("/","_",$image), $icon);
|
$iconFile = $this->imageManager->setCachedImage("icon-" . $app . '-' . str_replace("/","_",$image), $icon);
|
||||||
}
|
}
|
||||||
if ($iconFile !== false) {
|
if ($iconFile !== false) {
|
||||||
|
|
|
@ -177,7 +177,7 @@ class IconBuilder {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$svg = file_get_contents($imageFile);
|
$svg = file_get_contents($imageFile);
|
||||||
if ($svg !== false) {
|
if ($svg !== false && $svg !== "") {
|
||||||
$color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor());
|
$color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor());
|
||||||
$svg = $this->util->colorizeSvg($svg, $color);
|
$svg = $this->util->colorizeSvg($svg, $color);
|
||||||
return $svg;
|
return $svg;
|
||||||
|
|
Loading…
Reference in New Issue