diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index fbe1cb6a1c52..fcb210b0d7ad 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -281,7 +281,14 @@ class Utils } public static function getFromCache($id, $type) { - $data = Cache::get($type)->filter(function($item) use ($id) { + $cache = Cache::get($type); + + if ( ! $cache) { + static::logError("Cache for {$type} is not set"); + return null; + } + + $data = $cache->filter(function($item) use ($id) { return $item->id == $id; });