parseMovement: skip invalid stopL[] items 🐛

This commit is contained in:
Jannis R 2020-05-22 16:08:50 +02:00 committed by Jannis Redmann
parent 5fd2c27a06
commit 6b275171b1

View file

@ -19,7 +19,11 @@ const parseMovement = (ctx, m) => { // m = raw movement
longitude: m.pos.x / 1000000 longitude: m.pos.x / 1000000
} : null, } : null,
// todo: stopL[0] is the first of the trip! -> filter out // todo: stopL[0] is the first of the trip! -> filter out
nextStopovers: m.stopL.map(s => profile.parseStopover(ctx, s, m.date)), nextStopovers: (
m.stopL
.filter(s => !!s.location)
.map(s => profile.parseStopover(ctx, s, m.date))
),
frames: [] frames: []
} }