diff --git a/components/layout/product-grid-items.tsx b/components/layout/product-grid-items.tsx index b7903a52c..0c0e907ed 100644 --- a/components/layout/product-grid-items.tsx +++ b/components/layout/product-grid-items.tsx @@ -17,7 +17,7 @@ export default function ProductGridItems({ products }: { products: Product[] }) amount: product.priceRange.maxVariantPrice.amount, currencyCode: product.priceRange.maxVariantPrice.currencyCode }} - src={product.featuredImage.url} + src={product.featuredImage?.url} width={600} height={600} /> diff --git a/components/product/gallery.tsx b/components/product/gallery.tsx index fa54c90fc..12690d11e 100644 --- a/components/product/gallery.tsx +++ b/components/product/gallery.tsx @@ -82,7 +82,7 @@ export function Gallery({ onClick={() => setCurrentImage(index)} > } }); + if (!res.body.data.collection) { + console.log('No collection found for handle', handle); + return []; + } + return reshapeProducts(removeEdgesAndNodes(res.body.data.collection.products)); }