Permalink
Browse files

Added additional check when creating object from model with emded obj…

…ect.
  • Loading branch information...
1 parent 750ab50 commit 4153cdd89dd1a881293a3a8b045e824c433993a2 @agnek agnek committed with aheckmann Apr 24, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/document.js
View
@@ -225,7 +225,9 @@ function init (self, obj, doc, prefix) {
if (!schema && obj[i] && 'Object' === obj[i].constructor.name) {
// assume nested object
- doc[i] = {};
+ if(!doc[i]){
+ doc[i] = {};
+ }
init(self, obj[i], doc[i], path + '.');
} else {
if (obj[i] === null) {

0 comments on commit 4153cdd

Please sign in to comment.