main: fix missing location error

This commit is contained in:
Milan Pässler 2016-03-01 19:50:14 +01:00
parent 2e823a90c8
commit c541f5b721

View File

@ -87,7 +87,13 @@ function (moment, Router, L, GUI, numeral) {
ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id] ids = [d.source.node.nodeinfo.node_id, d.target.node.nodeinfo.node_id]
d.id = ids.join("-") 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 return
d.latlngs = [] d.latlngs = []