From d71e12713a13b3668ab9bdb4d184525ef8f80eea Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 19 May 2017 09:11:28 +0200 Subject: [PATCH] handle empty arrays when reducing --- rpc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc.js b/rpc.js index e2f62230b..54d7c14ec 100644 --- a/rpc.js +++ b/rpc.js @@ -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) {