From 476cfd42a72bcd3fb3ee0063d052163447c477f8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 8 Nov 2014 18:18:29 +0100 Subject: mfile->delete_id: Forgive if a dir doesn't exist Signed-off-by: Florian Pritz --- application/models/mfile.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'application') diff --git a/application/models/mfile.php b/application/models/mfile.php index c9827b6fd..eee2c4e5b 100644 --- a/application/models/mfile.php +++ b/application/models/mfile.php @@ -244,8 +244,10 @@ class Mfile extends CI_Model { unlink($this->file($filedata['hash'])); } $dir = $this->folder($filedata['hash']); - if (count(scandir($dir)) == 2) { - rmdir($dir); + if (file_exists($dir)) { + if (count(scandir($dir)) == 2) { + rmdir($dir); + } } } } -- cgit v1.2.3-24-g4f1b