From dc4a0e8b449efecf572ae70774a10638d92946dc Mon Sep 17 00:00:00 2001 From: Andreas Jonsson Date: Thu, 16 May 2024 09:14:55 +0200 Subject: [PATCH] Bug 36878: Silence spurious warning in C4::ILSDI Test plan: Review patch and verify that: * the only effect is that no warning will be emitted in the event the variable $status is undefined, and * the variable $status being undefined is normal and harmless. Signed-off-by: Chris Cormack --- C4/ILSDI/Services.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/ILSDI/Services.pm b/C4/ILSDI/Services.pm index ee776423a9..b54a10d731 100644 --- a/C4/ILSDI/Services.pm +++ b/C4/ILSDI/Services.pm @@ -395,12 +395,12 @@ sub AuthenticatePatron { my $username = $cgi->param('username'); my $password = $cgi->param('password'); my ($status, $cardnumber, $userid, $patron) = C4::Auth::checkpw( $username, $password ); - if ( $status == 1 ) { + if ( defined $status && $status == 1 ) { # Track the login $patron->update_lastseen('connection'); return { id => $patron->borrowernumber }; } - elsif ( $status == -2 ){ + elsif ( defined $status && $status == -2 ) { return { code => 'PasswordExpired' }; } else { -- 2.39.2