Fix deletion of user

This commit is contained in:
Laura Hausmann 2023-05-19 23:28:30 +02:00
parent e5e1c344dc
commit 335822966e
Signed by: zotan
GPG key ID: D044E84C5BE01605

View file

@ -46,7 +46,12 @@ public class CardController : Controller {
return NotFound(new ErrorResponse("No active link process"));
}
var user = db.Users.First(p => p.Id == int.Parse(linkFlag.Value));
var user = db.Users.FirstOrDefault(p => p.Id == int.Parse(linkFlag.Value));
if (user == null) {
return NotFound(new ErrorResponse("No active link process"));
}
linkFlag.Value = "";
var type = GetCardType(reader, card);