protect against empty results from bib searches caused by
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Jun 2010 16:14:31 +0000 (16:14 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 8 Jun 2010 16:14:31 +0000 (16:14 +0000)
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

index 08a7133..6784fd3 100644 (file)
@@ -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=".