handle empty arrays when reducing

pull/1/head
ansuz 8 years ago
parent e7a458295b
commit d71e12713a

@ -456,7 +456,7 @@ var sumChannelSizes = function (sizes) {
// only allow positive numbers
return !(typeof(x) !== 'number' || x <= 0);
})
.reduce(function (a, b) { return a + b; });
.reduce(function (a, b) { return a + b; }, 0);
};
var pinChannel = function (Env, publicKey, channels, cb) {

Loading…
Cancel
Save