提交 61ef5e9b 编写于 作者: B Brandon Casey 提交者: Junio C Hamano

git-send-email.perl: ensure $domain is defined before using it

valid_fqdn() may attempt to operate on an undefined value if
Net::Domain::domainname fails to determine the domain name.  This causes
perl to emit unpleasant warnings.

So, add a check for whether $domain has been defined before using it.
Signed-off-by: NBrandon Casey <drafnel@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b822423e
......@@ -895,7 +895,7 @@ sub sanitize_address {
sub valid_fqdn {
my $domain = shift;
return !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
return defined $domain && !($^O eq 'darwin' && $domain =~ /\.local$/) && $domain =~ /\./;
}
sub maildomain_net {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册