From c2f972e21949f53c2f713799085f302d9ec82041 Mon Sep 17 00:00:00 2001 From: Jacek Tomasiak Date: Mon, 29 Jul 2024 12:58:31 +0200 Subject: [PATCH] fix(files): Don't try to use missing cache entries The `Cache::get()` function can return `ICacheEntry` or `false`. Added check ensures that `false` return value is not used as an array. This silences: `Trying to access array offset on value of type bool` errors. Signed-off-by: Jacek Tomasiak --- lib/private/Files/Cache/Cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index a4290549dd92c..01586521a043f 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -870,7 +870,7 @@ public function correctFolderSize($path, $data = null, $isBackgroundScan = false } if ($isBackgroundScan) { $parentData = $this->get($parent); - if ($parentData['size'] !== -1 && $this->getIncompleteChildrenCount($parentData['fileid']) === 0) { + if ($parentData !== false && $parentData['size'] !== -1 && $this->getIncompleteChildrenCount($parentData['fileid']) === 0) { $this->correctFolderSize($parent, $parentData, $isBackgroundScan); } } else {