Skip to content

Commit

Permalink
fix(files): Don't try to use missing cache entries
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
skazi0 committed Jul 29, 2024
1 parent 1af3a66 commit c3b20ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Files/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c3b20ea

Please sign in to comment.