Skip to content

Commit c2f972e

Browse files
skazi0solracsf
authored andcommitted
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 <jacek.tomasiak@gmail.com>
1 parent b9f35a7 commit c2f972e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ public function correctFolderSize($path, $data = null, $isBackgroundScan = false
870870
}
871871
if ($isBackgroundScan) {
872872
$parentData = $this->get($parent);
873-
if ($parentData['size'] !== -1 && $this->getIncompleteChildrenCount($parentData['fileid']) === 0) {
873+
if ($parentData !== false && $parentData['size'] !== -1 && $this->getIncompleteChildrenCount($parentData['fileid']) === 0) {
874874
$this->correctFolderSize($parent, $parentData, $isBackgroundScan);
875875
}
876876
} else {

0 commit comments

Comments
 (0)