diff --git a/components/product/ProductView/ProductView.tsx b/components/product/ProductView/ProductView.tsx index 3d64ea0b3..6754f23a7 100644 --- a/components/product/ProductView/ProductView.tsx +++ b/components/product/ProductView/ProductView.tsx @@ -32,10 +32,11 @@ const ProductView: FC = ({ product }) => { useEffect(() => { // Selects the default option - product.variants[0].options?.forEach((v) => { + const options = product.variants[0].options || []; + options.forEach((v) => { setChoices((choices) => ({ ...choices, - [v.displayName.toLowerCase()]: v.values[0].label.toLowerCase(), + [v.displayName.toLowerCase()]: v.values[0]?.label.toLowerCase(), })) }) }, [])