Skip to content

Commit

Permalink
Merge pull request #46886 from nextcloud/fix-getmountsforfileid-array
Browse files Browse the repository at this point in the history
fix: ensure array returned from getMountsForFileId is continious
  • Loading branch information
icewind1991 authored Aug 2, 2024
2 parents b1a1da1 + eb4fb99 commit 8f70441
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 8f70441

Please sign in to comment.