Bug 27360: Prevent crash if branchcode does not exist

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-11-03 14:39:17 +01:00
parent 9176a7835f
commit d4fd7dcd9c

View file

@ -40,7 +40,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $found;
if ($branchcode) {
my $library = Koha::Libraries->find($branchcode);
if ( $library->public ) {
if ( $library && $library->public ) {
$found++;
$template->param( library => $library );
}