From 8a35d79a39e06229859f13d141215b443f76baa7 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Wed, 25 Sep 2013 10:39:15 +0200 Subject: [PATCH] check if svg of filetype icon exists --- lib/private/preview/unknown.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/preview/unknown.php b/lib/private/preview/unknown.php index 59667a77523..722bb727f57 100644 --- a/lib/private/preview/unknown.php +++ b/lib/private/preview/unknown.php @@ -20,9 +20,9 @@ class Unknown extends Provider { $path = \OC_Helper::mimetypeIcon($mimetype); $path = \OC::$SERVERROOT . substr($path, strlen(\OC::$WEBROOT)); - if (extension_loaded('imagick')) { - $path = substr_replace($path, 'svg', -3); + $svgPath = substr_replace($path, 'svg', -3); + if (extension_loaded('imagick') && file_exists($svgPath)) { $svg = new \Imagick(); $svg->setBackgroundColor(new \ImagickPixel('transparent')); $svg->readImage($path); -- 2.39.5