From 6a6ecebeb6bf3867ef3ac88b41e988c541e0f925 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 8 Jun 2010 16:14:31 +0000 Subject: [PATCH] protect against empty results from bib searches caused by search timeouts. This allows the API call to log the error and return reasonable results git-svn-id: svn://svn.open-ils.org/ILS/trunk@16625 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm index 08a71335b..6784fd39a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Search/Biblio.pm @@ -1153,7 +1153,7 @@ sub staged_search { $results = $U->storagereq($method, %$search_hash); $search_duration = time - $start; $logger->info("staged search: DB call took $search_duration seconds and returned ".scalar(@$results)." rows, including summary"); - $summary = shift(@$results); + $summary = shift(@$results) if $results; unless($summary) { $logger->info("search timed out: duration=$search_duration: params=". -- 2.11.0