@riosst100/pwa-marketplace 2.2.6 → 2.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@riosst100/pwa-marketplace",
3
3
  "author": "riosst100@gmail.com",
4
- "version": "2.2.6",
4
+ "version": "2.2.7",
5
5
  "main": "src/index.js",
6
6
  "pwa-studio": {
7
7
  "targets": {
@@ -107,7 +107,7 @@ const getMediaGalleryEntries = (product, optionCodes, optionSelections) => {
107
107
  const { media_gallery_entries, variants } = product;
108
108
  const isConfigurable = isProductConfigurable(product);
109
109
 
110
- let variantGallery = variants.flatMap(variant => variant.product.media_gallery_entries || []);
110
+ let variantGallery = variants && variants.length ? variants.flatMap(variant => variant.product.media_gallery_entries || []) : [];
111
111
  if (variantGallery) {
112
112
  // variantGallery = variantGallery.sort((a, b) => a.uid - b.uid);
113
113
  }