From 1cc453b778b4fb99da13d15cc422f72dec2fb36f Mon Sep 17 00:00:00 2001 From: Jannis R Date: Mon, 28 Oct 2019 17:43:12 +0100 Subject: [PATCH] parseArrOrDep, parseLocation: bugfixes :bug: --- parse/arrival-or-departure.js | 2 +- parse/location.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/parse/arrival-or-departure.js b/parse/arrival-or-departure.js index a59ec6db..1c376e6e 100644 --- a/parse/arrival-or-departure.js +++ b/parse/arrival-or-departure.js @@ -59,7 +59,7 @@ const createParseArrOrDep = (profile, opt, data, prefix) => { .filter(rem => !!rem) // filter unparsable } - if (opt.stopovers && d.stopL) { + if (opt.stopovers && Array.isArray(d.stopL)) { const parse = profile.parseStopover(profile, opt, data, d.date) // Filter stations the train passes without stopping, as this doesn't comply with FPTF (yet). const stopovers = d.stopL.map(parse).filter(st => !st.passBy) diff --git a/parse/location.js b/parse/location.js index e82df7eb..22d1023f 100644 --- a/parse/location.js +++ b/parse/location.js @@ -25,7 +25,7 @@ const parseLocation = (profile, opt, {lines}, l) => { const stop = { type: l.isMainMast ? 'station' : 'stop', id: res.id, - name: l.name ? profile.parseStationName(l.name) : null, + name: l.name || id.O ? profile.parseStationName(l.name || id.O) : null, location: 'number' === typeof res.latitude ? res : null // todo: remove `.id` }