Fix bug where it is not possible to create new members

This commit is contained in:
2023-03-13 17:22:02 +01:00
parent 11744a3d87
commit a17210e93c
3 changed files with 34 additions and 20 deletions

View File

@ -255,7 +255,7 @@ namespace WGneu.Helpers {
return new(true, "Not implemented yet");
}
public static ValidationResult CheckMgNr(TextBox input, bool optional, AppDbContext ctx, Member m) {
public static ValidationResult CheckMgNr(TextBox input, bool optional, AppDbContext ctx, Member? m) {
var res = CheckNumeric(input, optional);
if (!res.IsValid) {
return res;
@ -264,7 +264,7 @@ namespace WGneu.Helpers {
}
int nr = int.Parse(input.Text);
if (nr != m.MgNr && Utils.MgNrExists(ctx, nr)) {
if (nr != m?.MgNr && Utils.MgNrExists(ctx, nr)) {
return new(false, "Mitgliedsnummer wird bereits verwendet");
}