1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 21:06:11 +02:00

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: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brandon Casey 2010-09-26 22:18:01 -05:00 committed by Junio C Hamano
parent b822423ed2
commit 61ef5e9b56

View File

@ -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 {