diff options
Diffstat (limited to 'packages/assert/src')
-rw-r--r-- | packages/assert/src/index.ts | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/packages/assert/src/index.ts b/packages/assert/src/index.ts index f3b3651d5..95c7b658b 100644 --- a/packages/assert/src/index.ts +++ b/packages/assert/src/index.ts @@ -64,6 +64,9 @@ export const assert = { this.assert(isWeb3Provider, this.typeAssertionMessage(variableName, 'Provider', value)); }, doesConformToSchema(variableName: string, value: any, schema: Schema, subSchemas?: Schema[]): void { + if (_.isUndefined(value)) { + throw new Error(`${variableName} can't be undefined`); + } const schemaValidator = new SchemaValidator(); if (!_.isUndefined(subSchemas)) { _.map(subSchemas, schemaValidator.addSchema.bind(schemaValidator)); |