Skip to content

Commit

Permalink
fix(@ngtools/json-schema): aliases on invalid properties are noop
Browse files Browse the repository at this point in the history
  • Loading branch information
hansl committed Feb 22, 2017
1 parent 00f913c commit 68bd221
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/@ngtools/json-schema/src/schema-class-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ class SchemaClassBase<T> implements SchemaClass<T> {
/** Sets the value of a destination if the value is currently undefined. */
$$alias(source: string, destination: string) {
let sourceSchemaTreeNode = _getSchemaNodeForPath(this.$$schema(), source);
if (!sourceSchemaTreeNode) {
return false;
}

const fragments = _parseJsonPath(destination);
const maybeValue = fragments.reduce((value: any, current: string) => {
Expand Down

0 comments on commit 68bd221

Please sign in to comment.