From 3521b6278e05ad0baf0e0784f72d9a8c1e8f2f99 Mon Sep 17 00:00:00 2001
From: Shi Yao Wang <shi-yao.wang@inlibro.com>
Date: Fri, 29 Apr 2022 15:16:18 -0400
Subject: [PATCH] Bug 30556: Fix CanBookBeReserved to return early if no
 borrowernumber

---
 C4/Reserves.pm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/C4/Reserves.pm b/C4/Reserves.pm
index d291a888e6..61c1e35cb6 100644
--- a/C4/Reserves.pm
+++ b/C4/Reserves.pm
@@ -324,6 +324,8 @@ See CanItemBeReserved() for possible return values.
 sub CanBookBeReserved{
     my ($borrowernumber, $biblionumber, $pickup_branchcode, $params) = @_;
 
+    return { status => '' } unless $borrowernumber;
+
     # Check that patron have not checked out this biblio (if AllowHoldsOnPatronsPossessions set)
     if ( !C4::Context->preference('AllowHoldsOnPatronsPossessions')
         && C4::Circulation::CheckIfIssuedToPatron( $borrowernumber, $biblionumber ) ) {
-- 
2.25.1