From 309c1d23b73abe9a746fc2caf02c890a4840856a Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Wed, 2 Dec 2009 17:48:09 +0100 Subject: [PATCH] MT 2445 : SearchResults won't die if a record is incorrect --- C4/Search.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 65e516a5b4..8a62a40882 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1406,14 +1406,14 @@ sub searchResults { for ( my $i = $offset ; $i <= $times - 1 ; $i++ ) { my $marcrecord = MARC::File::USMARC::decode( $marcresults[$i] ); my $biblionumber; - + if(not $scan){ if ($bibliotag<10){ - $biblionumber = $marcrecord->field($bibliotag)->data; + $biblionumber = $marcrecord->field($bibliotag) ? $marcrecord->field($bibliotag)->data : undef; }else{ $biblionumber = $marcrecord->subfield($bibliotag,$bibliosubf); } - $fw = GetFrameworkCode($biblionumber); + $fw = (defined $biblionumber) ? GetFrameworkCode($biblionumber) : ''; } my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, $fw ); -- 2.39.5