Skip to content

Commit 84f7b91

Browse files
committed
fix: allow empty urls
1 parent 44bef32 commit 84f7b91

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/packages/media/imaging/imaging.repository.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class UmbImagingRepository extends UmbRepositoryBase implements UmbApi {
3636

3737
for (const unique of uniques) {
3838
const existingCrop = this.#dataStore.getCrop(unique, imagingModel);
39-
if (existingCrop) {
39+
if (existingCrop !== undefined) {
4040
urls.set(unique, existingCrop);
4141
continue;
4242
}
@@ -48,9 +48,11 @@ export class UmbImagingRepository extends UmbRepositoryBase implements UmbApi {
4848
continue;
4949
}
5050

51-
if (urlModels?.[0].url) {
52-
const url = urlModels[0].url;
53-
this.#dataStore.addCrop(unique, url, imagingModel);
51+
const url = urlModels?.[0].url;
52+
53+
this.#dataStore.addCrop(unique, url ?? '', imagingModel);
54+
55+
if (url) {
5456
urls.set(unique, url);
5557
}
5658
}

0 commit comments

Comments
 (0)