Permalink
Browse files

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

…value
  • Loading branch information...
1 parent b283a12 commit 66ed0e9f18a886a2386ce0b83bfa5ddf012b101f @aheckmann aheckmann committed Mar 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongoose/document.js
View
@@ -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);

0 comments on commit 66ed0e9

Please sign in to comment.