Skip to content

Commit

Permalink
fix: ensure array returned from getMountsForFileId is continious
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <robin@icewind.nl>
  • Loading branch information
icewind1991 authored and AndyScherzinger committed Aug 1, 2024
1 parent 5bfe8df commit 0dc0f1b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Files/Config/UserMountCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,9 @@ public function getMountsForFileId($fileId, $user = null) {
return $internalMountPath === '' || str_starts_with($internalPath, $internalMountPath . '/');
});

$filteredMounts = array_filter($filteredMounts, function (ICachedMountInfo $mount) {
$filteredMounts = array_values(array_filter($filteredMounts, function (ICachedMountInfo $mount) {
return $this->userManager->userExists($mount->getUser()->getUID());
});
}));

return array_map(function (ICachedMountInfo $mount) use ($internalPath) {
return new CachedMountFileInfo(
Expand Down

0 comments on commit 0dc0f1b

Please sign in to comment.