Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Jun 13, 2020
1 parent 2f81521 commit 93f3424
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/schema.js
Expand Up @@ -938,7 +938,8 @@ Schema.prototype.interpretAsType = function(path, obj, options) {
}
if (this._userProvidedOptions.hasOwnProperty('_id')) {
childSchemaOptions._id = this._userProvidedOptions._id;
} else if (Schema.Types.DocumentArray.defaultOptions._id != null) {
} else if (Schema.Types.DocumentArray.defaultOptions &&
Schema.Types.DocumentArray.defaultOptions._id != null) {
childSchemaOptions._id = Schema.Types.DocumentArray.defaultOptions._id;
}

Expand Down

0 comments on commit 93f3424

Please sign in to comment.