fix(core-flows): unsafe access to a variant property (#11588)

**What**
- fix unsafe access `manage_inventory` flag if variant doesn't exist for the item

---

CLOSES https://github.com/medusajs/medusa/issues/11587
This commit is contained in:
Frane Polić
2025-02-27 08:58:47 +01:00
committed by GitHub
parent 38beeb157e
commit 090d15b1e4

View File

@@ -172,7 +172,7 @@ export const listShippingOptionsForCartWorkflow = createWorkflow(
const itemsAtLocationWithoutAvailableQuantity = cart.items.filter(
(item) => {
if (!item.variant.manage_inventory) {
if (!item.variant?.manage_inventory) {
return false
}