We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 936741c commit 3c03ad4Copy full SHA for 3c03ad4
src/material/schematics/ng-generate/mdc-migration/rules/tree-traversal.ts
@@ -164,10 +164,13 @@ export function updateAttribute(
164
}
165
166
const attr = node.attributes[0];
167
- const ctx = attr.sourceSpan.start.getContext(attr.sourceSpan.start.col + 1, 1)!;
168
- const indentation = ctx.before;
+ if (attr) {
+ const ctx = attr.sourceSpan.start.getContext(attr.sourceSpan.start.col + 1, 1)!;
169
+ const indentation = ctx.before;
170
+ return prefix + indentation + attrText + suffix;
171
+ }
172
- return prefix + indentation + attrText + suffix;
173
+ return prefix + attrText + suffix;
174
175
176
/**
0 commit comments