From eb4fb994cf9162cb45a7909d5d5fa95b3b362afc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 30 Jul 2024 16:32:36 +0200 Subject: [PATCH] fix: ensure array returned from getMountsForFileId is continious Signed-off-by: Robin Appelman --- lib/private/Files/Config/UserMountCache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 66aa3a6607b9f..67b2cad7ea251 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -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(