fix: unsafe cast (#17590)

This commit is contained in:
Daniel Dietzler
2025-04-15 18:35:00 +02:00
committed by GitHub
parent 309528c807
commit 270d178a2e
2 changed files with 15 additions and 2 deletions
+5 -1
View File
@@ -165,7 +165,11 @@ export class AssetMediaService extends BaseService {
): Promise<AssetMediaResponseDto> {
try {
await this.requireAccess({ auth, permission: Permission.ASSET_UPDATE, ids: [id] });
const asset = (await this.assetRepository.getById(id)) as AssetEntity;
const asset = await this.assetRepository.getById(id);
if (!asset) {
throw new Error('Asset not found');
}
this.requireQuota(auth, file.size);