Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed; nested object property access works when root initd with null …

…value
  • Loading branch information...
commit 66ed0e9f18a886a2386ce0b83bfa5ddf012b101f 1 parent b283a12
@aheckmann aheckmann authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/mongoose/document.js
View
2  lib/mongoose/document.js
@@ -299,7 +299,7 @@ Document.prototype.get = function (path) {
obj = this.doc;
for (var i = 0, l = pieces.length; i < l; i++)
- obj = obj[pieces[i]];
+ obj = null === obj ? null : obj[pieces[i]];
if (schema)
obj = schema.applyGetters(obj, this);
Please sign in to comment.
Something went wrong with that request. Please try again.