diff --git a/modules/osm/intersection.js b/modules/osm/intersection.js index 7f918a815..bb89efea3 100644 --- a/modules/osm/intersection.js +++ b/modules/osm/intersection.js @@ -345,9 +345,11 @@ export function osmIntersection(graph, startVertexId) { n2 = vgraph.entity(way.nodes[0]); } - var toLoc = geoVecInterp(n1.loc, n2.loc, 10); // extend 1000% - n2 = n2.move(toLoc); - vgraph = vgraph.replace(n2); + if (n1.loc && n2.loc) { + var toLoc = geoVecInterp(n1.loc, n2.loc, 10); // extend 1000% + n2 = n2.move(toLoc); + vgraph = vgraph.replace(n2); + } });