From 527d8442a5b1042670d5a44ff327c2d9f6439252 Mon Sep 17 00:00:00 2001 From: "Alejandro R. Sedeno" Date: Thu, 23 Oct 2008 23:35:17 -0400 Subject: [PATCH] Fix a bug for checking input. --- lib/BarnOwl/Module/ColorUtils.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/BarnOwl/Module/ColorUtils.pm b/lib/BarnOwl/Module/ColorUtils.pm index 4e658c1..26e62bb 100644 --- a/lib/BarnOwl/Module/ColorUtils.pm +++ b/lib/BarnOwl/Module/ColorUtils.pm @@ -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)); } -- 2.45.2