aboutsummaryrefslogtreecommitdiff
path: root/src/fields/Schema.ts
diff options
context:
space:
mode:
authoranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-25 10:36:07 -0500
committeranika-ahluwalia <anika.ahluwalia@gmail.com>2020-07-25 10:36:07 -0500
commitb2ff3e5bf4892df51febf4b98e4a4bb977561392 (patch)
tree558f802071eec15f6fc6df45cb8ef9a22362e75d /src/fields/Schema.ts
parent229e8ba914943da0d11dff00d14a8adae950d853 (diff)
parent99e0b01dbe41e56cfdb748b53f03fe71d73a80b7 (diff)
merge w master
Diffstat (limited to 'src/fields/Schema.ts')
-rw-r--r--src/fields/Schema.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fields/Schema.ts b/src/fields/Schema.ts
index 98ef3e087..c6a8d6ae9 100644
--- a/src/fields/Schema.ts
+++ b/src/fields/Schema.ts
@@ -31,7 +31,7 @@ export function makeInterface<T extends Interface[]>(...schemas: T): InterfaceFu
}
const proto = new Proxy({}, {
get(target: any, prop, receiver) {
- const field = receiver.doc[prop];
+ const field = receiver.doc?.[prop];
if (prop in schema) {
const desc = prop === "proto" ? Doc : (schema as any)[prop]; // bcz: proto doesn't appear in schemas ... maybe it should?
if (typeof desc === "object" && "defaultVal" in desc && "type" in desc) {//defaultSpec