summaryrefslogtreecommitdiffstats
path: root/apps/theming/lib/IconBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/theming/lib/IconBuilder.php')
-rw-r--r--apps/theming/lib/IconBuilder.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index be3035eb0d8..d8161051ebb 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -25,6 +25,7 @@ namespace OCA\Theming;
use Imagick;
use ImagickPixel;
+use OCP\App\AppPathNotFoundException;
class IconBuilder {
/** @var ThemingDefaults */
@@ -85,8 +86,13 @@ class IconBuilder {
* @return Imagick|false
*/
public function renderAppIcon($app) {
- $appIcon = $this->util->getAppIcon($app);
- $appIconContent = file_get_contents($appIcon);
+ try {
+ $appIcon = $this->util->getAppIcon($app);
+ $appIconContent = file_get_contents($appIcon);
+ } catch (AppPathNotFoundException $e) {
+ return false;
+ }
+
if($appIconContent === false) {
return false;
}
@@ -158,7 +164,11 @@ class IconBuilder {
}
public function colorSvg($app, $image) {
- $imageFile = $this->util->getAppImage($app, $image);
+ try {
+ $imageFile = $this->util->getAppImage($app, $image);
+ } catch (AppPathNotFoundException $e) {
+ return false;
+ }
$svg = file_get_contents($imageFile);
if ($svg !== false) {
$color = $this->util->elementColor($this->themingDefaults->getMailHeaderColor());