mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parseMovement: skip invalid stopL[] items 🐛
This commit is contained in:
parent
5fd2c27a06
commit
6b275171b1
1 changed files with 5 additions and 1 deletions
|
@ -19,7 +19,11 @@ const parseMovement = (ctx, m) => { // m = raw movement
|
|||
longitude: m.pos.x / 1000000
|
||||
} : null,
|
||||
// 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: []
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue