Skip to content

Commit

Permalink
fix(material/schematics): add undefined check (#26081)
Browse files Browse the repository at this point in the history
* potential fix for issue #26038
  • Loading branch information
wagnermaciel authored Nov 28, 2022
1 parent 936741c commit 3c03ad4
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,13 @@ export function updateAttribute(
}

const attr = node.attributes[0];
const ctx = attr.sourceSpan.start.getContext(attr.sourceSpan.start.col + 1, 1)!;
const indentation = ctx.before;
if (attr) {
const ctx = attr.sourceSpan.start.getContext(attr.sourceSpan.start.col + 1, 1)!;
const indentation = ctx.before;
return prefix + indentation + attrText + suffix;
}

return prefix + indentation + attrText + suffix;
return prefix + attrText + suffix;
}

/**
Expand Down

0 comments on commit 3c03ad4

Please sign in to comment.