From: Liam Whalen Date: Tue, 7 Jan 2014 03:22:50 +0000 (-0800) Subject: LP1271559 fix z39.50 timeout Staff Client network error X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a2d5c97c0d73706fd6080c097ec4beae9424ffee;p=working%2FEvergreen.git 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. --- 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); + } } }