diff --git a/Koha/Template/Plugin/Branches.pm b/Koha/Template/Plugin/Branches.pm index 0031bfe89d..04ec4140c8 100644 --- a/Koha/Template/Plugin/Branches.pm +++ b/Koha/Template/Plugin/Branches.pm @@ -39,7 +39,9 @@ sub GetName { sub GetLoggedInBranchcode { my ($self) = @_; - return C4::Context->userenv->{'branch'} if C4::Context->userenv; + return C4::Context->userenv ? + C4::Context->userenv->{'branch'} : + ''; } 1;