Skip to content

Commit 1db57d4

Browse files
alan-agius4mgechev
authored andcommitted
fix(@schematics/angular): return undefined instead of throw when file is not found
Follow up on #16063
1 parent 6602d90 commit 1db57d4

File tree

1 file changed

+1
-1
lines changed
  • packages/schematics/angular/migrations/update-9

1 file changed

+1
-1
lines changed

packages/schematics/angular/migrations/update-9/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function getWorkspace(host: Tree): JsonAstObject {
9696
export function readJsonFileAsAstObject(host: Tree, path: string): JsonAstObject | undefined {
9797
const configBuffer = host.read(path);
9898
if (!configBuffer) {
99-
throw new SchematicsException(`Could not find (${path})`);
99+
return undefined;
100100
}
101101

102102
const content = configBuffer.toString();

0 commit comments

Comments
 (0)