Skip to content

Commit a0aa14f

Browse files
committed
fix(cdk/schematics): handle templates with byte order mark (#27131)
Fixes that migrations may throw a "Character out of bounds" error if a template is using BOM. Fixes #27057. (cherry picked from commit 3cb369e)
1 parent 82550af commit a0aa14f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cdk/schematics/update-tool/component-resource-collector.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export class ComponentResourceCollector {
155155
return;
156156
}
157157

158-
const fileContent = this._fileSystem.read(templatePath);
158+
const fileContent = stripBom(this._fileSystem.read(templatePath) || '');
159159

160160
if (fileContent) {
161161
const lineStartsMap = computeLineStartsMap(fileContent);

0 commit comments

Comments
 (0)