From 3ca59392c2cc080941faa9e69de09627a1ad9738 Mon Sep 17 00:00:00 2001 From: teromene Date: Sat, 5 May 2018 18:05:48 +0100 Subject: [PATCH] Fix for crashes when accessing FileCache in case it has been purged/not created yet. --- caches/FileCache.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caches/FileCache.php b/caches/FileCache.php index 20323aa..0ca36d2 100644 --- a/caches/FileCache.php +++ b/caches/FileCache.php @@ -8,7 +8,9 @@ class FileCache implements CacheInterface { protected $param; public function loadData(){ - return unserialize(file_get_contents($this->getCacheFile())); + if(file_exists($this->getCacheFile())) { + return unserialize(file_get_contents($this->getCacheFile())); + } } public function saveData($datas){