bugfixes: fix undefined variables 🐛

This commit is contained in:
Julius Tens 2020-02-27 15:49:41 +01:00
parent db94a62649
commit bc30309056
2 changed files with 3 additions and 6 deletions

View file

@ -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) => {

View file

@ -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`
}