diff --git a/cache/stores/file/lib.php b/cache/stores/file/lib.php index dd5e05825e4..0c08710d551 100644 --- a/cache/stores/file/lib.php +++ b/cache/stores/file/lib.php @@ -399,7 +399,7 @@ class cachestore_file extends cache_store implements cache_is_key_aware, cache_i public function delete($key) { $filename = $key.'.cache'; $file = $this->file_path_for_key($key); - if (@unlink($file)) { + if (file_exists($file) && @unlink($file)) { unset($this->keys[$filename]); return true; }