From a2d5c97c0d73706fd6080c097ec4beae9424ffee Mon Sep 17 00:00:00 2001 From: Liam Whalen Date: Mon, 6 Jan 2014 19:22:50 -0800 Subject: [PATCH] LP1271559 fix z39.50 timeout Staff Client network error When doing a z39.50 search in the staff client, if a z39.50 server timesout, then the result set returned is null. Currenlty, this breaks the code on the server and sends a Network Error to the staff client. This code adds a check to ensure that the results are populated in order to avoid creating the server error. --- Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm index c830844577..0a391d8bc3 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm @@ -299,9 +299,12 @@ sub do_class_search { my $ev = $connections[$index - 1]->last_event(); $logger->debug("z3950: Received event $ev"); if ($ev == OpenILS::Utils::ZClient::EVENT_END()) { - my $munged = process_results( $results[$index - 1], $$args{limit}, $$args{offset}, $$args{service}[$index -1] ); - $$munged{service} = $$args{service}[$index - 1]; - $conn->respond($munged); + #check to make sure a result was returned otherwise an undef results[] value breaks process_results + if ($results[$index -1]) { + my $munged = process_results( $results[$index - 1], $$args{limit}, $$args{offset}, $$args{service}[$index -1] ); + $$munged{service} = $$args{service}[$index - 1]; + $conn->respond($munged); + } } } -- 2.11.0