|
|
@@ -74,7 +74,10 @@ var Document = module.exports = (function(){
|
|
|
for(var key in document){
|
|
|
if(document.hasOwnProperty(key)){
|
|
|
var withObjVal = document[key];
|
|
|
- if(withObjVal.constructor === Object){
|
|
|
+ if(withObjVal === null) { // necessary to handle null values without failing
|
|
|
+ obj[key] = withObjVal;
|
|
|
+ }
|
|
|
+ else if(withObjVal.constructor === Object){
|
|
|
obj[key] = Document.clone(withObjVal);
|
|
|
}else{
|
|
|
obj[key] = withObjVal;
|