Don't use $author_name undefined when $from contains no /\s</.
[gitweb.git] / git-send-email.perl
index b17d2619875112215465c7399fa30e592ed71b01..1c6d2cc7872ab82020d9dc32ce0086b1d3139e22 100755 (executable)
@@ -412,7 +412,7 @@ sub send_message
        }
 
        my ($author_name) = ($from =~ /^(.*?)\s+</);
-       if ($author_name =~ /\./ && $author_name !~ /^".*"$/) {
+       if ($author_name && $author_name =~ /\./ && $author_name !~ /^".*"$/) {
                my ($name, $addr) = ($from =~ /^(.*?)(\s+<.*)/);
                $from = "\"$name\"$addr";
        }