From 27cc9e96777f6b99c3bd9a842e5aa68e976dcd3f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 13 Nov 2023 15:49:30 +0100 Subject: [PATCH] don't return a 'sparse' array from getMountsForFileId Signed-off-by: Robin Appelman --- lib/private/Files/Config/UserMountCache.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Config/UserMountCache.php b/lib/private/Files/Config/UserMountCache.php index 7502d65d0445c..e2bcb21f0dc69 100644 --- a/lib/private/Files/Config/UserMountCache.php +++ b/lib/private/Files/Config/UserMountCache.php @@ -369,7 +369,7 @@ public function getMountsForFileId($fileId, $user = null) { }); $filteredMounts = array_filter(array_map([$this, 'dbRowToMountInfo'], $filteredMounts)); - return array_map(function (ICachedMountInfo $mount) use ($internalPath) { + $result = array_map(function (ICachedMountInfo $mount) use ($internalPath) { return new CachedMountFileInfo( $mount->getUser(), $mount->getStorageId(), @@ -381,6 +381,7 @@ public function getMountsForFileId($fileId, $user = null) { $internalPath ); }, $filteredMounts); + return array_values($result); } /**