Skip to content

Commit

Permalink
Fix empty DirectionName gives error
Browse files Browse the repository at this point in the history
  • Loading branch information
ludc-octo committed Dec 16, 2022
1 parent decb7d9 commit f0bc572
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/fetcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const fetchTimetables = async (
...visits,
...(trains.reduce(
(acc: { [x: string]: [] }, visit: any) => {
const dir = visit.MonitoredVehicleJourney.DirectionName
const dir = (visit.MonitoredVehicleJourney.DirectionName && visit.MonitoredVehicleJourney.DirectionName.length > 0)
? visit.MonitoredVehicleJourney.DirectionName[0].value
: ''

Expand Down

0 comments on commit f0bc572

Please sign in to comment.