diff options
| author | Copilot <198982749+Copilot@users.noreply.github.com> | 2025-11-17 23:13:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-17 23:13:28 +0100 |
| commit | 90904924f6dd30cccac91b9da2e9baeabf8c0ff4 (patch) | |
| tree | a9c6a8cc6fd05ca520210247b2be4d0ef590b7a2 /src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs | |
| parent | 1b4f8fc28af8bea87c8cc7a6548948a566d7fb9f (diff) | |
Fix InvalidOperationException when stops have no real-time arrivals (#99)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com>
Diffstat (limited to 'src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs')
| -rw-r--r-- | src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs index 05a3025..7cc3fcb 100644 --- a/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs +++ b/src/Costasdev.Busurbano.Backend/Controllers/VigoController.cs @@ -100,9 +100,8 @@ public class VigoController : ControllerBase var now = nowLocal.AddSeconds(60 - nowLocal.Second); // Define the scope end as the time of the last realtime arrival (no extra buffer) - var lastEstimateArrivalMinutes = realTimeEstimates.Max(e => e.Minutes); var scopeEnd = realTimeEstimates.Count > 0 - ? now.AddMinutes(Math.Min(lastEstimateArrivalMinutes + 5, 75)) + ? now.AddMinutes(Math.Min(realTimeEstimates.Max(e => e.Minutes) + 5, 75)) : now.AddMinutes(60); // If no estimates, show next hour of scheduled only List<ConsolidatedCirculation> consolidatedCirculations = []; |
