quick fix

This commit is contained in:
Laura Hausmann 2020-10-19 01:55:36 +02:00
parent 7f6560a6aa
commit 7a9d63b1a4
Signed by: zotan
GPG Key ID: 5EC1D38FFC321311
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}