From 7a9d63b1a47072d25104245907d679712ea68ecd Mon Sep 17 00:00:00 2001 From: Laura Hausmann Date: Mon, 19 Oct 2020 01:55:36 +0200 Subject: [PATCH] quick fix --- bahnplan.web/Pages/Trip.cshtml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bahnplan.web/Pages/Trip.cshtml.cs b/bahnplan.web/Pages/Trip.cshtml.cs index 055cdba..6b77071 100644 --- a/bahnplan.web/Pages/Trip.cshtml.cs +++ b/bahnplan.web/Pages/Trip.cshtml.cs @@ -37,12 +37,13 @@ namespace bahnplan.web.Pages { return; } + Legs = db.Legs.Where(p => p.TripId == int.Parse(Request.Query["id"])).OrderBy(p => p.DepTime).ToList(); + if (!db.Legs.Any(p => p.TripId == int.Parse(Request.Query["id"]))) { RedirToIndex = true; return; } - Legs = db.Legs.Where(p => p.TripId == int.Parse(Request.Query["id"])).OrderBy(p => p.DepTime).ToList(); User = db.Users.First(p => p.UserId == Legs.First().UserId).Username; }