diff options
author | Julius Härtl <jus@bitgrid.net> | 2017-05-14 23:48:51 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2017-05-17 10:11:29 +0200 |
commit | 1157f413c9a5c89994f0477b97726a2aef64e44e (patch) | |
tree | cb95f5c237e5f7a8584e4cc84f04396e45ed7fc2 /apps/theming/lib/IconBuilder.php | |
parent | 443cbdc73931c0deec5bc01634ec9b512486d769 (diff) | |
download | nextcloud-server-1157f413c9a5c89994f0477b97726a2aef64e44e.tar.gz nextcloud-server-1157f413c9a5c89994f0477b97726a2aef64e44e.zip |
Fallback to default favicon
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/lib/IconBuilder.php')
-rw-r--r-- | apps/theming/lib/IconBuilder.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 7db24c4a2b0..477ba966c64 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -52,14 +52,18 @@ class IconBuilder { * @return string|false image blob */ public function getFavicon($app) { - $icon = $this->renderAppIcon($app, 32); - if($icon === false) { + try { + $icon = $this->renderAppIcon($app, 32); + if ($icon === false) { + return false; + } + $icon->setImageFormat("png24"); + $data = $icon->getImageBlob(); + $icon->destroy(); + return $data; + } catch (\ImagickException $e) { return false; } - $icon->setImageFormat("png24"); - $data = $icon->getImageBlob(); - $icon->destroy(); - return $data; } /** @@ -67,14 +71,18 @@ class IconBuilder { * @return string|false image blob */ public function getTouchIcon($app) { - $icon = $this->renderAppIcon($app, 512); - if($icon === false) { + try { + $icon = $this->renderAppIcon($app, 512); + if ($icon === false) { + return false; + } + $icon->setImageFormat("png24"); + $data = $icon->getImageBlob(); + $icon->destroy(); + return $data; + } catch (\ImagickException $e) { return false; } - $icon->setImageFormat("png24"); - $data = $icon->getImageBlob(); - $icon->destroy(); - return $data; } /** |