From: Bjoern Schiessle Date: Mon, 25 Jun 2012 08:15:20 +0000 (+0200) Subject: Only delete existing thumbnails (bug #1100) X-Git-Tag: v4.5.0beta1~74^2~403^2~26 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9ee528bc74a924def23168cd2ef8ccbdcbc649c8;p=nextcloud-server.git Only delete existing thumbnails (bug #1100) --- diff --git a/apps/gallery/lib/managers.php b/apps/gallery/lib/managers.php index d4d978dbdd0..fcce3f40e23 100644 --- a/apps/gallery/lib/managers.php +++ b/apps/gallery/lib/managers.php @@ -86,7 +86,10 @@ class ThumbnailsManager { } public function delete($path) { - unlink(\OCP\Config::getSystemValue('datadirectory').'/'.\OC_User::getUser()."/gallery".$path); + $thumbnail = \OCP\Config::getSystemValue('datadirectory').'/'.\OC_User::getUser()."/gallery".$path; + if (file_exists($thumbnail)) { + unlink($thumbnail); + } } private function __construct() {}