From 191569ebaaaee6225eb4c23a7cd398443e026a96 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 29 Oct 2021 12:27:25 +0200 Subject: [PATCH] Bug 29374: Don't crash if search engine returns a deleted record Signed-off-by: Jonathan Druart (cherry picked from commit 20991feb62daedf5827b29e986002a34b0d41cce) Signed-off-by: Andrew Fuerste-Henry --- C4/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Search.pm b/C4/Search.pm index 02a1ed2f98..4de5f237a6 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2041,7 +2041,7 @@ sub searchResults { $can_place_holds = 0; } } else { - $can_place_holds = $biblio_object->items->filter_by_for_hold()->count; + $can_place_holds = $biblio_object->items->filter_by_for_hold()->count if $biblio_object; } $oldbiblio->{norequests} = 1 unless $can_place_holds; $oldbiblio->{items_count} = $items_count; -- 2.39.5