From: Don Armstrong Date: Wed, 17 Sep 2008 16:04:04 +0000 (-0700) Subject: * Handle when tags aren't set in usertags X-Git-Tag: release/2.6.0~472^2~7 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bcb4de0614509714f9f4721770c28a769c0cfbe0;p=debbugs.git * Handle when tags aren't set in usertags --- diff --git a/scripts/service b/scripts/service index 47585bd9..ccdd0f77 100755 --- a/scripts/service +++ b/scripts/service @@ -387,12 +387,14 @@ END Debbugs::User::read_usertags(\%ut, $user); my @oldtags = (); my @newtags = (); my @badtags = (); my %chtags; - for my $t (split /[,\s]+/, $tags) { - if ($t =~ m/^[a-zA-Z0-9.+\@-]+$/) { - $chtags{$t} = 1; - } else { - push @badtags, $t; - } + if (defined $tags and length $tags) { + for my $t (split /[,\s]+/, $tags) { + if ($t =~ m/^[a-zA-Z0-9.+\@-]+$/) { + $chtags{$t} = 1; + } else { + push @badtags, $t; + } + } } if (@badtags) { print {$transcript} "Ignoring illegal tag/s: ".join(', ', @badtags).".\nPlease use only alphanumerics, at, dot, plus and dash.\n";