From f4a5206ae059132f9623e1873c2450fa6152206a Mon Sep 17 00:00:00 2001 From: biblibre Date: Tue, 8 Mar 2011 10:28:38 +0100 Subject: [PATCH] Bug 6137: fix a Circulation bug. userenv null Signed-off-by: Chris Cormack --- C4/Circulation.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 7b2a317c54..93c6fac996 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1968,8 +1968,8 @@ sub _GetCircControlBranch { my $circcontrol = C4::Context->preference('CircControl'); my $branch; - if ($circcontrol eq 'PickupLibrary') { - $branch= C4::Context->userenv->{'branch'} if C4::Context->userenv; + if ($circcontrol eq 'PickupLibrary' and (C4::Context->userenv and C4::Context->userenv->{'branch'}) ) { + $branch= C4::Context->userenv->{'branch'}; } elsif ($circcontrol eq 'PatronLibrary') { $branch=$borrower->{branchcode}; } else { -- 2.39.5