From 3d85237ad10a83be17be994dc806ad45d0209d6a Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 27 Jun 2017 13:45:11 +0200 Subject: [PATCH] Add check for empty result in storage memcache --- lib/private/Files/Cache/Storage.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index 94cc9bea3fae..e7e8d2d8b7aa 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -109,7 +109,7 @@ public static function getStorageById($storageId) { self::$localCache = new CappedMemoryCache(); } $result = self::$localCache->get($storageId); - if ($result === null) { + if ($result === null || empty($result) || !isset($result['numeric_id'])) { $result = self::getStorageByIdFromCache($storageId); self::$localCache->set($storageId, $result); } @@ -134,7 +134,7 @@ private static function getDistributedCache() { */ private static function getStorageByIdFromCache($storageId) { $result = self::getDistributedCache()->get($storageId); - if ($result === null) { + if ($result === null || empty($result) || !isset($result['numeric_id'])) { $result = self::getStorageByIdFromDb($storageId); self::getDistributedCache()->set( $storageId, $result, self::$distributedCacheTTL