Skip to content

Commit f7a7188

Browse files
authored
Merge pull request #1 from mcanoglu/mcanoglu-patch-ngadd-error
optional chaining to prevent error during ng add
2 parents 5ae2726 + 0e24419 commit f7a7188

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libs/ddd/src/schematics/utils/update-linting-rules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function checkRuleExists(rules: object, context: SchematicContext) {
3232

3333
export function addDomainToLintingRules(domainName: string): Rule {
3434
return (host: Tree, context: SchematicContext) => {
35-
const text = host.read('tslint.json').toString();
35+
const text = host.read('tslint.json')?.toString();
3636
const rules = JSON.parse(text);
3737

3838
if (!checkRuleExists(rules, context)) return;
@@ -97,4 +97,4 @@ export function initLintingRules(): Rule {
9797
const newText = JSON.stringify(rules, undefined, 2);
9898
host.overwrite('tslint.json', newText);
9999
}
100-
}
100+
}

0 commit comments

Comments
 (0)