fix: error when rendering null alternates
This commit is contained in:
@ -90,9 +90,11 @@
|
|||||||
]);
|
]);
|
||||||
const res = await fetchRoute(ROUTING_SERVER, req);
|
const res = await fetchRoute(ROUTING_SERVER, req);
|
||||||
routes = [res.trip];
|
routes = [res.trip];
|
||||||
for (const alternate of res.alternates) {
|
if(res.alternates) {
|
||||||
if (alternate.trip) {
|
for (const alternate of res.alternates) {
|
||||||
routes.push(alternate.trip);
|
if (alternate.trip) {
|
||||||
|
routes.push(alternate.trip);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawAllRoutes(routes);
|
drawAllRoutes(routes);
|
||||||
|
|||||||
Reference in New Issue
Block a user