From ee0eb7aa58e92e4dc21068dac668d52627c720ce Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 31 Oct 2009 15:31:22 -0500 Subject: get rid of a warning when no coderef is passed to command --- lib/IM/Engine/Plugin/Commands/OO.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/IM/Engine/Plugin/Commands/OO.pm b/lib/IM/Engine/Plugin/Commands/OO.pm index 0d7753a..43321fa 100644 --- a/lib/IM/Engine/Plugin/Commands/OO.pm +++ b/lib/IM/Engine/Plugin/Commands/OO.pm @@ -7,7 +7,7 @@ sub command { my $caller = shift; my $name = shift; my $code; - $code = shift if reftype($_[0]) eq 'CODE'; + $code = shift if defined(reftype($_[0])) && reftype($_[0]) eq 'CODE'; my %args = @_; my $method_meta = $caller->meta->get_method($name); -- cgit v1.2.3