Skip to content

Commit

Permalink
feat(@angular-devkit/architect): getOptionsForTarget should return null
Browse files Browse the repository at this point in the history
If the target does not exist in the workspace.
  • Loading branch information
hansl authored and vikerman committed Mar 13, 2019
1 parent e2163a0 commit 128af10
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,11 @@ export class WorkspaceNodeModulesArchitectHost implements ArchitectHost<NodeModu
return this._root;
}

async getOptionsForTarget(target: Target): Promise<json.JsonObject> {
async getOptionsForTarget(target: Target): Promise<json.JsonObject | null> {
const targetSpec = this._workspace.getProjectTargets(target.project)[target.target];
if (targetSpec === undefined) {
return null;
}
if (target.configuration && !targetSpec['configurations']) {
throw new Error('Configuration not set in the workspace.');
}
Expand Down

0 comments on commit 128af10

Please sign in to comment.