From: Kartik Thakore Date: Sat, 15 Aug 2009 14:32:04 +0000 (-0400) Subject: Forces defined parameters to blit X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=59f13fbaf456c061a7ed030ea560ba68f9217656;p=sdlgit%2FSDL_perl.git Forces defined parameters to blit --- diff --git a/lib/SDL/Surface.pm b/lib/SDL/Surface.pm index 16eaefb..378907e 100644 --- a/lib/SDL/Surface.pm +++ b/lib/SDL/Surface.pm @@ -209,7 +209,8 @@ sub blit { croak "SDL::Surface::blit requires SDL::Surface objects" unless $_[2]->isa('SDL::Surface'); } - SDL::BlitSurface(map { $_ != 0 ? ${$_} : $_ } @_); + + SDL::BlitSurface(map { (defined($_) && $_ != 0)? ${$_} : croak "SDL::blit() Parameters need to be defined" } @_) if defined(@_); } sub set_colors {