avoid crashes if record in result set is corrupted

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Joshua Ferraro 2008-04-11 05:50:51 -04:00
parent 419d8fc0d8
commit bedb9fffa0

View file

@ -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}) ) {