Browse Source

Fix for crashes when accessing FileCache in case it has been purged/not created yet.

teromene 6 years ago
parent
commit
3ca59392c2
1 changed files with 3 additions and 1 deletions
  1. 3 1
      caches/FileCache.php

+ 3 - 1
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){