diff --git a/src/RWFileCache.php b/src/RWFileCache.php index c4c48ad..a8ebbe4 100644 --- a/src/RWFileCache.php +++ b/src/RWFileCache.php @@ -107,6 +107,11 @@ public function get($key) $cacheObj = json_decode($cacheFileData); + // Unable to decode JSON (could happen if compression was turned off while compressed caches still exist) + if ($cacheObj===false) { + return false; + } + $unixLoad = sys_getloadavg(); if ($cacheObj->expiryTimestamp > time() || $unixLoad[0] >= $this->config['unixLoadUpperThreshold']) {