]> git.imager.perl.org - imager.git/commitdiff
don't attempt to save the palette if we failed to read the image
authorTony Cook <tony@develop=help.com>
Mon, 25 Jun 2007 02:55:06 +0000 (02:55 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 25 Jun 2007 02:55:06 +0000 (02:55 +0000)
Imager.pm

index f59aa4621c9147b7bd0dbacfd826b369fe4358ad..b6131c9633b15c666f75158478b919c78cb0b7ad 100644 (file)
--- 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})) ];
       }