From fbf2c260935ba75134f25e5a64be24787784eee1 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Fri, 29 Nov 2013 18:07:50 +0100 Subject: [PATCH] // Fix when file is missing --- controllers/admin/AdminAttachmentsController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index 7732107eb..58983c9e8 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -92,7 +92,9 @@ class AdminAttachmentsControllerCore extends AdminController if (($obj = $this->loadObject(true)) && Validate::isLoadedObject($obj)) { $link = $this->context->link->getPageLink('attachment', true, NULL, 'id_attachment='.$obj->id); - $size = round(filesize(_PS_DOWNLOAD_DIR_.$obj->file) / 1024); + + if (file_exists(_PS_DOWNLOAD_DIR_.$obj->file)) + $size = round(filesize(_PS_DOWNLOAD_DIR_.$obj->file) / 1024); } $this->fields_form = array(