From f8985e80f8971375cf268eadfe18358d9a3c8eb6 Mon Sep 17 00:00:00 2001 From: Ere Maijala Date: Wed, 16 Sep 2020 14:37:23 +0300 Subject: [PATCH] Bug 20447: (follow-up) Fix holding_branch getter to handle null This fix avoids an internal server error when holdingbranch column is empty in the database. This could happen e.g. when there's a problem with the framework's Koha field mapping. --- Koha/Holding.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/Koha/Holding.pm b/Koha/Holding.pm index 42b4a0bdd7..cbba9315dd 100644 --- a/Koha/Holding.pm +++ b/Koha/Holding.pm @@ -54,6 +54,7 @@ sub holding_branch { my ($self) = @_; my $branch = $self->_result->holdingbranch(); + return unless $branch; return Koha::Library->_new_from_dbic($branch); } -- 2.11.0