Commit ca9e6d50 authored by Tristan Cavelier's avatar Tristan Cavelier

replicatestorage instanciation bug -> fixed

parent 154f0305
......@@ -743,22 +743,23 @@
function replicateStorage(spec, my) {
var error, priv = {}, that = my.basicStorage(spec, my);
if (typeof spec.conditions !== 'object' ||
Object.getPrototypeOf(spec.conditions) !== Object.prototype) {
if (spec.conditions !== undefined &&
(typeof spec.conditions !== 'object' ||
Object.getPrototypeOf(spec.conditions) !== Object.prototype)) {
error = new TypeError("ReplicateStorage(): " +
"'conditions' is not of type 'object'");
}
if (Array.isArray(spec.storage_list)) {
if (!Array.isArray(spec.storage_list) || spec.storage_list.length === 0) {
error = new TypeError("ReplicateStorage(): " +
"'storage_list' is not of type 'array'");
"'storage_list' is not an array which length > 0");
}
//////////////////////////////
// Overrides
that.validateState = function () {
return error && error.message;
return (error || '') && error.message;
};
that.specToStore = function () {
......
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