瀏覽代碼

fix: fix FileAccess::getByFileId(InStorage)

Signed-off-by: Robin Appelman <robin@icewind.nl>
Robin Appelman 3 周之前
父節點
當前提交
8d870a32c2
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      lib/private/Files/Cache/FileAccess.php

+ 2 - 2
lib/private/Files/Cache/FileAccess.php

@@ -56,7 +56,7 @@ class FileAccess implements IFileAccess {
 	}
 
 	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 @@ class FileAccess implements IFileAccess {
 	}
 
 	public function getByFileId(int $fileId): ?CacheEntry {
-		$items = $this->getByFileIds([$fileId]);
+		$items = array_values($this->getByFileIds([$fileId]));
 		return $items[0] ?? null;
 	}