Avoid Z39.50 search warning for uninit var
authorDan Scott <dscott@laurentian.ca>
Mon, 24 Jun 2013 14:12:50 +0000 (10:12 -0400)
committerMike Rylander <mrylander@gmail.com>
Wed, 17 Jul 2013 17:36:55 +0000 (13:36 -0400)
The debug log blindly attempts to access list members that might not
exist (if, for example, an event code was returned from the attempt to
run do_service_search()), thus generating spurious log warnings.
Instead, move the debug line to only generate output when we have
created the list item in question.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Z3950.pm

index f9c88df..dba3706 100644 (file)
@@ -277,10 +277,11 @@ sub do_class_search {
                 push @services, $tmp_args{service}; 
                 push @results, $res->{result}; 
                 push @connections, $res->{connection}; 
+
+                $logger->debug("z3950: Result object: $results[$i], Connection object: $connections[$i]");
             } 
         }
 
-        $logger->debug("z3950: Result object: $results[$i], Connection object: $connections[$i]");
     }
 
     $logger->debug("z3950: Connections created");