From c541f5b721bce0f1777bb470e9f10176e107f469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20P=C3=A4ssler?= Date: Tue, 1 Mar 2016 19:50:14 +0100 Subject: [PATCH] main: fix missing location error --- lib/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/main.js b/lib/main.js index 38f85e3..5fd96d6 100644 --- a/lib/main.js +++ b/lib/main.js @@ -87,7 +87,13 @@ function (moment, Router, L, GUI, numeral) { ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id] d.id = ids.join("-") - if (unknown || !("location" in d.source.node.nodeinfo && "location" in d.target.node.nodeinfo)) + if (unknown || + !d.source.node.nodeinfo.location || + !d.target.node.nodeinfo.location || + isNaN(d.source.node.nodeinfo.location.latitude) || + isNaN(d.source.node.nodeinfo.location.longitude) || + isNaN(d.target.node.nodeinfo.location.latitude) || + isNaN(d.target.node.nodeinfo.location.longitude)) return d.latlngs = []