diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 027f512a47df..d0b17df7f021 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -274,7 +274,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; });