From 7cc404fda47055d4c39473b782acfd1e8d55f0a8 Mon Sep 17 00:00:00 2001 From: Cyklan Date: Tue, 3 Jan 2023 17:14:05 +0100 Subject: [PATCH] fix(shopify): prevent CheckoutDoesNotExist Error --- .../storefront-shop-adapter-shopify/src/providers/cart.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/storefront-shop-adapter-shopify/src/providers/cart.ts b/packages/storefront-shop-adapter-shopify/src/providers/cart.ts index ba622f4..c0dcd41 100755 --- a/packages/storefront-shop-adapter-shopify/src/providers/cart.ts +++ b/packages/storefront-shop-adapter-shopify/src/providers/cart.ts @@ -110,7 +110,10 @@ export class StorefrontShopAdapterShopifyCart } } - if (responseGetCheckout.data.node.completedAt) { + if ( + responseGetCheckout.data.node == null || + responseGetCheckout.data.node.completedAt + ) { return createCheckout({ input: {} }) }