From ca8d6f894f992d484b267c07d92c3000f3bd475b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matt=C3=A9o=20Delabre?= Date: Mon, 27 Jul 2020 23:48:10 +0200 Subject: [PATCH] Allow for unknown stops in side pane --- src/front/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/front/index.js b/src/front/index.js index 2ca7618..870cba1 100644 --- a/src/front/index.js +++ b/src/front/index.js @@ -29,7 +29,9 @@ setInterval(() => { const timeToHTML = time => Math.ceil((time - Date.now()) / 1000); - const stopToHTML = stopId => network.stops[stopId].properties.name; + const stopToHTML = stopId => stopId in network.stops ? + network.stops[stopId].properties.name : + 'ArrĂȘt inconnu'; const passingsToHTML = passings => passings.map(([stopId, time]) => `