From bedb9fffa02605b6ecb4d12f312b8b5d382e27a7 Mon Sep 17 00:00:00 2001 From: Joshua Ferraro Date: Fri, 11 Apr 2008 05:50:51 -0400 Subject: [PATCH] avoid crashes if record in result set is corrupted Signed-off-by: Joshua Ferraro --- C4/XSLT.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/C4/XSLT.pm b/C4/XSLT.pm index 4a383fbdbf..786bec89db 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -56,7 +56,12 @@ sub transformMARCXML4XSLT { my $biblio = GetBiblioData($biblionumber); my $frameworkcode = GetFrameworkCode($biblionumber); my $tagslib = &GetMarcStructure(1,$frameworkcode); - my @fields = $record->fields(); + my @fields; + # FIXME: wish there was a better way to handle exceptions + eval { + @fields = $record->fields(); + }; + if ($@) { warn "PROBLEM WITH RECORD"; next; } my $list_of_authvalues = getAuthorisedValues4MARCSubfields($frameworkcode); for my $authvalue (@$list_of_authvalues) { for my $field ( $record->field($authvalue->{tagfield}) ) { -- 2.39.5