fix nullref if no trains are matched

master
Laura Hausmann 3 years ago
parent 918ceb8e77
commit 05dd171e6b
Signed by: zotan
GPG Key ID: 5EC1D38FFC321311
  1. 8
      ZTravel.Web/Pages/Shared/_LayoutFern.cshtml

@ -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…
Cancel
Save