From 4c6ba69dd381b3661935eb0e7bdc75ee8581e586 Mon Sep 17 00:00:00 2001 From: Milan Paessler Date: Thu, 2 Jun 2016 23:17:06 +0200 Subject: [PATCH] meshstats: don't count undefined as gateway --- lib/meshstats.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/meshstats.js b/lib/meshstats.js index e9b9845..96d19fd 100644 --- a/lib/meshstats.js +++ b/lib/meshstats.js @@ -15,7 +15,9 @@ define(function () { return d.statistics.gateway }).concat(d.nodes.all.filter( function (d) { return d.flags.gateway - })))).map(one)) + })))).map(function(d) { + return (typeof d === "string") ? 1 : 0 + })) var nodetext = [{ count: totalOnlineNodes, label: "online" }, { count: totalNewNodes, label: "neu" },