]> git.donarmstrong.com Git - debbugs.git/commitdiff
* Handle when tags aren't set in usertags
authorDon Armstrong <don@donarmstrong.com>
Wed, 17 Sep 2008 16:04:04 +0000 (09:04 -0700)
committerDon Armstrong <don@donarmstrong.com>
Wed, 17 Sep 2008 16:04:04 +0000 (09:04 -0700)
scripts/service

index 47585bd91e1597039ace5f980ffd71fa217f8b6d..ccdd0f778af34b6e42e1520a84a634e2a33dbeaf 100755 (executable)
@@ -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";