]> asedeno.scripts.mit.edu Git - ColorUtils.git/commitdiff
Fix a bug for checking input.
authorAlejandro R. Sedeno <asedeno@darkmatter.mit.edu>
Fri, 24 Oct 2008 03:35:17 +0000 (23:35 -0400)
committerAlejandro R. Sedeño <asedeno@mit.edu>
Mon, 9 Nov 2009 22:41:20 +0000 (17:41 -0500)
lib/BarnOwl/Module/ColorUtils.pm

index 4e658c1ac094a86119b9c54a074f2241a53d6e01..26e62bb95552bb2344d1cf7a04965786b7c43a02 100644 (file)
@@ -251,8 +251,9 @@ sub cmd_setcolor {
         'instance' => \$inst,
     );
 
+    return unless ((scalar @ARGV) > 0);
     my $color = shift @ARGV;
-
+    
     if ($color =~ /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i) {
         $color = find_color(hex($1),hex($2),hex($3));
     }