From fe99800a2e39fba1c6369bdfe3f600119308514a Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Wed, 8 Sep 2010 16:03:15 -0400 Subject: [PATCH] Bug 5182 - Attempting to export a patron card with no text causes an error to be thrown Can't use an undefined value as an ARRAY reference at /home/koha/koha.prod/C4/Patroncards/Patroncard.pm line 86. This is caused by testing for text at line 87 rather than line 85. This patch moves the test to line 85. --- C4/Patroncards/Patroncard.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5