Permalink
Browse files

fixed; non-mixed type object setters work after initd from null

  • Loading branch information...
1 parent ed13f49 commit c59251ba583f82c9448f85548ec00c0e4792d3a3 @aheckmann aheckmann committed Mar 30, 2011
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/mongoose/document.js
View
@@ -223,7 +223,7 @@ Document.prototype.set = function (path, val) {
if (i + 1 == l)
obj[parts[i]] = val;
else {
- obj = obj[parts[i]];
+ obj = obj[parts[i]] || (obj[parts[i]] = {});
}
}
}

0 comments on commit c59251b

Please sign in to comment.