Skip to content

Commit

Permalink
Merge pull request #1702 from contentstack/fix/DX-1781
Browse files Browse the repository at this point in the history
DX-1781, added optional chaining
  • Loading branch information
naman-contentstack authored Dec 9, 2024
2 parents 67e116e + 7e9d01d commit 26400aa
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 26400aa

Please sign in to comment.