Skip to content

Commit 68bd221

Browse files
committed
fix(@ngtools/json-schema): aliases on invalid properties are noop
1 parent 00f913c commit 68bd221

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/@ngtools/json-schema/src/schema-class-factory.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ class SchemaClassBase<T> implements SchemaClass<T> {
9696
/** Sets the value of a destination if the value is currently undefined. */
9797
$$alias(source: string, destination: string) {
9898
let sourceSchemaTreeNode = _getSchemaNodeForPath(this.$$schema(), source);
99+
if (!sourceSchemaTreeNode) {
100+
return false;
101+
}
99102

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

0 commit comments

Comments
 (0)