From 806918a10e42fde60240dcc785d8e175dc8507b5 Mon Sep 17 00:00:00 2001 From: Sebastian Rindom Date: Fri, 26 Mar 2021 15:11:37 +0100 Subject: [PATCH] fix: update all contentful --- .../src/services/contentful.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/medusa-plugin-contentful/src/services/contentful.js b/packages/medusa-plugin-contentful/src/services/contentful.js index da5e3bc765..5fed5759a4 100644 --- a/packages/medusa-plugin-contentful/src/services/contentful.js +++ b/packages/medusa-plugin-contentful/src/services/contentful.js @@ -449,9 +449,14 @@ class ContentfulService extends BaseService { "options", ] - const found = variant.fields.find((f) => updateFields.includes(f)) - if (!found) { - return + // Update came directly from product variant service so only act on a couple + // of fields. When the update comes from the product we want to ensure + // references are set up correctly so we run through everything. + if (variant.fields) { + const found = variant.fields.find((f) => updateFields.includes(f)) + if (!found) { + return + } } try {