fix nullref if no trains are matched
This commit is contained in:
parent
918ceb8e77
commit
05dd171e6b
|
@ -35,7 +35,13 @@
|
|||
</div>
|
||||
<div class="app applight">
|
||||
<ul>
|
||||
@foreach (var dep in DbfApi.GetDepartures("dbf.finalrewind.org", station, via).Where(dep => !fernverkehrOnly || dep.TrainClasses.Contains("F") || dep.Destination == andShowDestination).Where(dep => !onlyDepartures || !string.IsNullOrWhiteSpace(dep.ScheduledDeparture))) {
|
||||
@foreach (var dep in DbfApi.GetDepartures("dbf.finalrewind.org", station, via)) {
|
||||
if (fernverkehrOnly && !dep.TrainClasses.Contains("F") && dep.Destination != andShowDestination) {
|
||||
continue;
|
||||
}
|
||||
if (onlyDepartures && string.IsNullOrWhiteSpace(dep.ScheduledDeparture)) {
|
||||
continue;
|
||||
}
|
||||
if (dep.Route.Select(r => r.Name).Contains(excludingVia)) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue