From bc30309056c445b9e40a09a9308efef3b3b1bc7f Mon Sep 17 00:00:00 2001 From: Julius Tens Date: Thu, 27 Feb 2020 15:49:41 +0100 Subject: [PATCH] bugfixes: fix undefined variables :bug: --- p/oebb/index.js | 7 ++----- parse/location.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/p/oebb/index.js b/p/oebb/index.js index 93a0f279..4b494fca 100644 --- a/p/oebb/index.js +++ b/p/oebb/index.js @@ -49,11 +49,8 @@ const fixMovement = ({parsed}, m) => { // filter out POIs // todo: make use of them, as some of them specify fare zones parsed.nextStopovers = parsed.nextStopovers.filter(st => { - const s = st.stop || {} - if (s.station) { - s = s.station - if (s.station.type === 'stop' || s.station.type === 'station') return true - } + let s = st.stop || {} + if (s.station) s = s.station return s.type === 'stop' || s.type === 'station' }) parsed.frames = parsed.frames.filter((f) => { diff --git a/parse/location.js b/parse/location.js index 0d755b70..bb9d439b 100644 --- a/parse/location.js +++ b/parse/location.js @@ -27,7 +27,7 @@ const parseLocation = (ctx, l) => { const stop = { type: l.isMainMast ? 'station' : 'stop', id: res.id, - name: l.name || id.O ? profile.parseStationName(ctx, l.name || id.O) : null, + name: l.name || lid.O ? profile.parseStationName(ctx, l.name || lid.O) : null, location: 'number' === typeof res.latitude ? res : null // todo: remove `.id` }