Skip to content

Commit

Permalink
chore: handle undefined images (#927)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatheusTrindade5201 authored Oct 15, 2024
1 parent deae9c0 commit afbd96d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vtex/utils/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ export const toProduct = <P extends LegacyProductVTEX | ProductVTEX>(
items
.flatMap((i) => i.images)
.reduce((map, img) => {
map.set(getImageKey(img.imageUrl), img.imageUrl);
img?.imageUrl && map.set(getImageKey(img.imageUrl), img.imageUrl);
return map;
}, new Map<string, string>());

Expand Down

0 comments on commit afbd96d

Please sign in to comment.