Skip to content

Commit

Permalink
Fix(pageSection): Fix error attempting to access attribute of undefin…
Browse files Browse the repository at this point in the history
…ed (#789)
  • Loading branch information
wise-king-sullyman authored Oct 15, 2024
1 parent 0f28de0 commit f8e049b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = {
const pageSectionVariantLocalName =
pageSectionVariantImport && pageSectionVariantImport.local.name;
const hasPatternFlyEnum =
variantValue.object &&
variantValue?.object &&
variantValue.object.name === pageSectionVariantLocalName;
const variantValueIsLiteral =
variantProp.value.type === "Literal" ||
Expand All @@ -46,7 +46,7 @@ module.exports = {
if (!variantValueIsLiteral && !hasPatternFlyEnum) {
return;
}
const hasValidValue = variantValue.property
const hasValidValue = variantValue?.property
? validValues.includes(variantValue.property.name)
: validValues.includes(variantValue);

Expand Down

0 comments on commit f8e049b

Please sign in to comment.