From: Tony Cook Date: Mon, 25 Jun 2007 02:55:06 +0000 (+0000) Subject: don't attempt to save the palette if we failed to read the image X-Git-Tag: Imager-0.60~35 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/a5dbf458215163bb4fa4d585e0b41bd6a4616cb4 don't attempt to save the palette if we failed to read the image --- diff --git a/Imager.pm b/Imager.pm index f59aa462..b6131c96 100644 --- a/Imager.pm +++ b/Imager.pm @@ -1356,7 +1356,7 @@ sub read { my $page = $input{'page'}; defined $page or $page = 0; $self->{IMG} = i_readgif_single_wiol( $IO, $page ); - if ($input{colors}) { + if ($self->{IMG} && $input{colors}) { ${ $input{colors} } = [ i_getcolors($self->{IMG}, 0, i_colorcount($self->{IMG})) ]; }