partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 1f80c0f0fff0f6befd6f58dc63cc7256a1e4e4a8
parent c409619f39cbcc95d73e6a383955ca526c8455ea
Author: Felicitus <felicitus@felicitus.org>
Date:   Sat, 26 Sep 2015 19:52:55 +0200

Check if the file exists prior removal

Diffstat:
Msrc/PartKeepr/ImageBundle/Services/ImageService.php | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/PartKeepr/ImageBundle/Services/ImageService.php b/src/PartKeepr/ImageBundle/Services/ImageService.php @@ -45,7 +45,9 @@ class ImageService extends UploadedFileService /** * @var $file CachedImage */ - unlink($file->getCacheFile()); + if (file_exists($file->getCacheFile())) { + unlink($file->getCacheFile()); + } $entityManager->remove($file); } }