diff --git a/C4/Auth.pm b/C4/Auth.pm index 40ef948a33..d4b83bb75e 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -2062,7 +2062,7 @@ sub checkpw { @return = (); } elsif ($passwd_ok) { $patron->update( { login_attempts => 0 } ); - if ( $patron->borrowernumber eq $anonymous_patron ) { + if ( defined($anonymous_patron) && ($patron->borrowernumber eq $anonymous_patron) ) { @return = ( -3, $patron ); } elsif ( $patron->password_expired ) { @return = ( -2, $patron );