From 5abc825cdfaa16580dd05045cdf9847ecd3fcd60 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Sun, 30 Aug 2026 14:53:20 +0200 Subject: Handle null locations in JS --- web/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web/index.js') diff --git a/web/index.js b/web/index.js index 999e333..5e7323b 100644 --- a/web/index.js +++ b/web/index.js @@ -143,8 +143,11 @@ async function load(gpxFile) { el("code", {}, txt(sit.id)), txt(": " + firstComment)); - const markerLayer = L.marker(sit.location); - markerLayer.addTo(layerGroup).bindPopup(commentEl); + // TODO: decide what to do if the situation has no location + if (sit.location) { + const markerLayer = L.marker(sit.location); + markerLayer.addTo(layerGroup).bindPopup(commentEl); + } sit.relevant_road_closures.forEach((rc) => { rc.relevant_lss.forEach((ls) => { -- cgit v1.3