From d54dd270d7ceaa9f8097ac75cb87fcbf69ee3a47 Mon Sep 17 00:00:00 2001 From: Qiyun Dai Date: Fri, 7 Jun 2024 18:26:35 -0500 Subject: [PATCH] Update product-promotion-component-controller.js --- .../controllers/product-promotion-component-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/form-handler/controllers/product-promotion-component-controller.js b/blocks/form-handler/controllers/product-promotion-component-controller.js index b95e360f..e1da06a1 100644 --- a/blocks/form-handler/controllers/product-promotion-component-controller.js +++ b/blocks/form-handler/controllers/product-promotion-component-controller.js @@ -1,7 +1,7 @@ export function onSubmit(component, props) { const productGroup = component.querySelector('product-selector-group'); - const selectedProducts = productGroup.getSelectedProducts(); + const selectedProducts = productGroup?.getSelectedProducts(); const relatedProducts = selectedProducts.map((p) => ({ name: p.title,