Skip to content

Commit

Permalink
DX-1781, added optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
naman-contentstack committed Dec 9, 2024
1 parent 3e7467c commit 7e9d01d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/contentstack-variants/src/import/experiences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@ export default class Experiences extends PersonalizationAdapter<ImportConfig> {
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
Expand Down

0 comments on commit 7e9d01d

Please sign in to comment.