Fix SharedTrip 500 error
This commit is contained in:
parent
ca91093555
commit
2554b89ed2
|
@ -13,8 +13,10 @@ namespace bahnplan.web.Pages {
|
|||
public void OnGet() {
|
||||
using var db = new Database.DbConn();
|
||||
|
||||
if (!db.Legs.Any(p => p.TripId == int.Parse(Request.Query["id"])))
|
||||
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;
|
||||
|
|
Reference in a new issue