From c8e34cce73316965eadd6ac702d0c76e36e113f9 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 26 Aug 2013 17:37:14 +0200 Subject: [PATCH] Bug 10684 - Followup Koha search dies on undecodable records Prevent future error. Signed-off-by: Jonathan Druart --- C4/Search.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 26d482d..1f6ea66 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1698,9 +1698,11 @@ sub searchResults { # loop through all of the records we've retrieved for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { - my $marcrecord = eval { MARC::File::USMARC::decode( $marcresults->[$i] ) }; - warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i] if $@; - next if $@; + my $marcrecord = eval { MARC::File::USMARC::decode( $marcresults->[$i] ); }; + if ( $@ ) { + warn "ERROR DECODING RECORD - $@: " . $marcresults->[$i]; + next; + } my $fw = $scan ? undef -- 1.7.10.4