Fix for Reserves.t allow the tests to run without a logged in user
authorChris Cormack <chrisc@catalyst.net.nz>
Thu, 14 Apr 2011 03:03:37 +0000 (15:03 +1200)
committerChris Cormack <chrisc@catalyst.net.nz>
Thu, 14 Apr 2011 03:03:37 +0000 (15:03 +1200)
C4/Circulation.pm

index b977524..9a2db4c 100644 (file)
@@ -1924,7 +1924,7 @@ sub _GetCircControlBranch {
     my $branch;
 
     if ($circcontrol eq 'PickupLibrary') {
-        $branch= C4::Context->userenv->{'branch'};
+        $branch= C4::Context->userenv->{'branch'} if C4::Context->userenv;
     } elsif ($circcontrol eq 'PatronLibrary') {
         $branch=$borrower->{branchcode};
     } else {