Skip to content

Commit

Permalink
fix; don't crash if paths doesn't have options (Fix #1824)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 14, 2015
1 parent 11f0f5b commit 89ac6e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/document.js
Expand Up @@ -456,7 +456,9 @@ Document.prototype.set = function (path, val, type, options) {
&& (!path[key].constructor || 'Object' == path[key].constructor.name)
&& 'virtual' != pathtype
&& !(this.$__path(pathName) instanceof MixedSchema)
&& !(this.schema.paths[pathName] && this.schema.paths[pathName].options.ref)) {
&& !(this.schema.paths[pathName] &&
this.schema.paths[pathName].options &&
this.schema.paths[pathName].options.ref)) {
this.set(path[key], prefix + key, constructing);
} else if (strict) {
if ('real' === pathtype || 'virtual' === pathtype) {
Expand Down

0 comments on commit 89ac6e6

Please sign in to comment.