Bug 8057 - Error when adding a patron with email address

Caused by code assuming a the variable $err is a hashref
when it is only a hashref if there is an error.

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Kyle M Hall 2012-05-08 15:49:10 -04:00 committed by Chris Cormack
parent 2397702f62
commit 54d475bdcf
1 changed files with 1 additions and 1 deletions

View File

@ -354,7 +354,7 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){
};
if ( $@ ) {
$template->param(error_alert => $@);
} elsif ( defined $err->{error} and $err->{error} eq "no_email" ) {
} elsif ( ref($err) eq "HASH" && defined $err->{error} and $err->{error} eq "no_email" ) {
$template->{VARS}->{'error_alert'} = "no_email";
} else {
$template->{VARS}->{'info_alert'} = 1;