add empty array fallback just in case for now

This commit is contained in:
mertalev 2025-04-01 15:58:32 -04:00
parent 33c9ea1c9c
commit 0da1c3b279
No known key found for this signature in database
GPG Key ID: DF6ABC77AAD98C95

View File

@ -14,7 +14,7 @@ import { IBulkAsset, ImmichFile, UploadFile } from 'src/types';
import { checkAccess } from 'src/utils/access';
export const getAssetFile = (files: AssetFileEntity[], type: AssetFileType | GeneratedImageType) => {
return files.find((file) => file.type === type);
return (files || []).find((file) => file.type === type);
};
export const getAssetFiles = (files: AssetFileEntity[]) => ({