X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=lib%2FZOOM%2FIRSpy%2FTest%2FResultSet%2FNamed.pm;h=8bc7625ce3eaaec4816021184843ab366c7e32fb;hp=346b4ec16dcc7e69ba1efb86a08d5012d4a06536;hb=98baec5c4e8bf6ed1a629127f54a52b9aa1c564e;hpb=e5180c16e801d76543ffe470b02dea0a3c3d766c diff --git a/lib/ZOOM/IRSpy/Test/ResultSet/Named.pm b/lib/ZOOM/IRSpy/Test/ResultSet/Named.pm index 346b4ec..8bc7625 100644 --- a/lib/ZOOM/IRSpy/Test/ResultSet/Named.pm +++ b/lib/ZOOM/IRSpy/Test/ResultSet/Named.pm @@ -1,4 +1,4 @@ -# $Id: Named.pm,v 1.2 2007-02-23 15:03:44 mike Exp $ +# $Id: Named.pm,v 1.3 2007-03-05 12:53:57 mike Exp $ # See the "Main" test package for documentation @@ -31,9 +31,17 @@ sub completed_search_a { my $record = ''; my $hits = $rs->size(); - ## How should be handle the situation when there is 0 hits? + ## How should we handle the situation when there is 0 hits? if ($hits > 0) { - $record = $rs->record(0)->raw(); + my $rsrec = $rs->record(0); + if (!defined $rsrec) { + # I thought this was a "can't happen", but it sometimes + # does, as for example documented for + # kat.vkol.cz:9909/svk02 at ../../../../../tmp/bad-run-1 + eval { $conn->check() }; + return error($conn, $task, $test_args, $@); + } + $record = $rsrec->raw(); } $conn->irspy_search_pqf("\@attr 1=4 4ds9da94",