diff --git a/C4/Patroncards/Patroncard.pm b/C4/Patroncards/Patroncard.pm index 20939768bb..23cba15005 100644 --- a/C4/Patroncards/Patroncard.pm +++ b/C4/Patroncards/Patroncard.pm @@ -83,8 +83,8 @@ sub draw_text { my ($self, $pdf, %params) = @_; warn sprintf('No pdf object passed in.') and return -1 if !$pdf; my @card_text = (); + return unless (ref($self->{'layout'}->{'text'}) eq 'ARRAY'); # just in case there is not text my $text = [@{$self->{'layout'}->{'text'}}]; # make a copy of the arrayref *not* simply a pointer - return unless (ref($text) eq 'ARRAY'); # just in case there is not text while (scalar @$text) { my $line = shift @$text; my $parse_line = $line;