File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,16 +161,20 @@ const TrainDataFetcher: FC<IProps> = ({
161161 ? stopAndRoutes . find ( el => el . routes . match ( / \d + $ / ) ?. [ 0 ] === id )
162162 ?. routes
163163 : train . commuterLineid ;
164- trainsWithTrack . push ( {
165- lineId : line ,
166- trainNumber : train . trainNumber ,
167- time : formattedDateTimeFromSeconds (
168- utcToSeconds ( train . timeTableRows [ idx ] ?. scheduledTime ) ,
169- 'yyyy-MM-dd HH:mm:ss' ,
170- ) ,
171- timeInSecs : utcToSeconds ( train . timeTableRows [ idx ] ?. scheduledTime ) ,
172- track : train . timeTableRows [ idx ] ?. commercialTrack ,
173- } ) ;
164+ if ( train . timeTableRows [ idx ] ) {
165+ trainsWithTrack . push ( {
166+ lineId : line ,
167+ trainNumber : train . trainNumber ,
168+ time : formattedDateTimeFromSeconds (
169+ utcToSeconds ( train . timeTableRows [ idx ] . scheduledTime ) ,
170+ 'yyyy-MM-dd HH:mm:ss' ,
171+ ) ,
172+ timeInSecs : utcToSeconds (
173+ train . timeTableRows [ idx ] . scheduledTime ,
174+ ) ,
175+ track : train . timeTableRows [ idx ] . commercialTrack ,
176+ } ) ;
177+ }
174178 }
175179 } ) ;
176180 } ) ;
You can’t perform that action at this time.
0 commit comments