Check if image files for theming are empty

Signed-off-by: Julius Haertl <jus@bitgrid.net>
pull/2588/head
Julius Haertl 9 years ago
parent e3b2832ee1
commit 5fbadee95f
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
  1. 3
      apps/theming/lib/Controller/IconController.php
  2. 2
      apps/theming/lib/IconBuilder.php

@ -94,6 +94,9 @@ class IconController extends Controller {
$iconFile = $this->imageManager->getCachedImage("icon-" . $app . '-' . str_replace("/","_",$image));
} catch (NotFoundException $exception) {
$icon = $this->iconBuilder->colorSvg($app, $image);
if ($icon === false || $icon === "") {
return new NotFoundResponse();
}
$iconFile = $this->imageManager->setCachedImage("icon-" . $app . '-' . str_replace("/","_",$image), $icon);
}
if ($iconFile !== false) {

@ -172,7 +172,7 @@ class IconBuilder {
return false;
}
$svg = file_get_contents($imageFile);
if ($svg !== false) {
if ($svg !== false && $svg !== "") {
$color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor());
$svg = $this->util->colorizeSvg($svg, $color);
return $svg;

Loading…
Cancel
Save