From 5e07ef7ae703e272c162324fa5a1d9ff676f2be9 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 20 Sep 2024 09:07:42 +0000 Subject: [PATCH] Bug 37892: (QA follow-up) Fix condition in memberentry Patron may be undefined. So the test may crash. Also there is an issue with operator precedence. Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer (cherry picked from commit cfc953a411448c814328b26841c496369604408d) Signed-off-by: Lucas Gass --- members/memberentry.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 17c1f0305a..8903ecfcfa 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -280,7 +280,9 @@ if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) } foreach my $guarantor (@guarantors) { - if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && ($guarantor->is_child ) || $guarantor->is_guarantee || $patron->is_guarantor) { + if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) + && ( $guarantor->is_child || $guarantor->is_guarantee || ( $patron && $patron->is_guarantor ) ) ) + { push @errors, 'ERROR_guarantor_is_guarantee'; } }