Selaa lähdekoodia

Refs #2208. Fixed bug in cloning a document with a null value.

Spencer Rathbun 12 vuotta sitten
vanhempi
commit
b4c7570ada
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  1. 4 1
      lib/pipeline/Document.js

+ 4 - 1
lib/pipeline/Document.js

@@ -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;