From 1d3633df3ca93349ec0139fa31e9884cc7b944e7 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 15 Dec 2021 12:36:17 -1000 Subject: [PATCH] Bug 29690: (follow-up) Add eval on metadata record fetch in get_marc_authors() --- Koha/Biblio.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index afecf22ca6..ceae2b1d3d 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -1011,7 +1011,10 @@ sub get_marc_authors { my @marcauthors; my $AuthoritySeparator = C4::Context->preference('AuthoritySeparator'); - foreach my $field ( $self->metadata->record->field($fields_filter) ) { + my $record = eval { $self->metadata->record }; + unless ( $record ) { warn $@ ; return } + + foreach my $field ( $record->field($fields_filter) ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; my @subfields_loop; my @link_loop; -- 2.34.0