From 2b1713be1471d2c046da4ff7b04c691bfb64e76c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 1 May 2024 18:00:20 +0200 Subject: [PATCH] fix: fix FileAccess::getByFileId(InStorage) Signed-off-by: Robin Appelman --- lib/private/Files/Cache/FileAccess.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Cache/FileAccess.php b/lib/private/Files/Cache/FileAccess.php index a75056a271d52..af74a96822bc0 100644 --- a/lib/private/Files/Cache/FileAccess.php +++ b/lib/private/Files/Cache/FileAccess.php @@ -56,7 +56,7 @@ private function getQuery(): CacheQueryBuilder { } public function getByFileIdInStorage(int $fileId, int $storageId): ?CacheEntry { - $items = $this->getByFileIdsInStorage([$fileId], $storageId); + $items = array_values($this->getByFileIdsInStorage([$fileId], $storageId)); return $items[0] ?? null; } @@ -70,7 +70,7 @@ public function getByPathInStorage(string $path, int $storageId): ?CacheEntry { } public function getByFileId(int $fileId): ?CacheEntry { - $items = $this->getByFileIds([$fileId]); + $items = array_values($this->getByFileIds([$fileId])); return $items[0] ?? null; }