Fix bug where it is not possible to create new members
This commit is contained in:
@ -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");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user