From c8cf6e733c834d374e9f437e754f0c958162ce28 Mon Sep 17 00:00:00 2001 From: Greg Hoskin Date: Sun, 16 May 2021 13:31:57 -0700 Subject: [PATCH] fix error from missing product imgages --- framework/swell/utils/normalize.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/swell/utils/normalize.ts b/framework/swell/utils/normalize.ts index 5e54428ca..8dc7d0e28 100644 --- a/framework/swell/utils/normalize.ts +++ b/framework/swell/utils/normalize.ts @@ -198,7 +198,10 @@ function normalizeLineItem({ sku: variant?.sku ?? '', name: variant?.name!, image: { - url: product && product.images ? product?.images[0].file.url : '', + url: + product?.images && product.images.length > 0 + ? product?.images[0].file.url + : '/', }, requiresShipping: false, price: price,