diff --git a/packages/contentstack-variants/src/import/experiences.ts b/packages/contentstack-variants/src/import/experiences.ts index 52479d7f18..c0bf9eb400 100644 --- a/packages/contentstack-variants/src/import/experiences.ts +++ b/packages/contentstack-variants/src/import/experiences.ts @@ -238,7 +238,8 @@ export default class Experiences extends PersonalizationAdapter { try { const promises = this.pendingVariantAndVariantGrpForExperience.map(async (expUid) => { const expRes = await this.getExperience(expUid); - if (expRes?._cms && expRes?._cms?.variantGroup && Object.keys(expRes._cms.variants).length > 0) { + const variants = expRes?._cms?.variants ?? {}; + if (expRes?._cms && expRes?._cms?.variantGroup && Object.keys(variants).length > 0) { this.cmsVariants[expUid] = expRes._cms?.variants ?? {}; this.cmsVariantGroups[expUid] = expRes._cms?.variantGroup ?? {}; return expUid; // Return the expUid for filtering later