Commit 4ae4e5be authored by Tristan Cavelier's avatar Tristan Cavelier

fix jiotests clone function which crashed when trying to clone undefined

parent 2e934806
...@@ -25,7 +25,11 @@ contains = function (array,content) { ...@@ -25,7 +25,11 @@ contains = function (array,content) {
return false; return false;
}, },
clone = function (obj) { clone = function (obj) {
return JSON.parse(JSON.stringify(obj)); var tmp = JSON.stringify(obj);
if (tmp !== undefined) {
return JSON.parse(tmp);
}
return tmp;
}, },
// generates a revision hash from document metadata, revision history // generates a revision hash from document metadata, revision history
// and the deleted_flag // and the deleted_flag
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment