Merge pull request #177 from jaredj/address-test-warning

Avoid warnings for Qpsmtpd::Address->new(undef)
This commit is contained in:
Matt Simerson 2014-12-30 12:29:24 -08:00
commit 101bfa7bbd

View File

@ -56,7 +56,10 @@ use overload (
sub new { sub new {
my ($class, $user, $host) = @_; my ($class, $user, $host) = @_;
my $self = {}; my $self = {};
if ($user =~ /^<(.*)>$/) { if (! defined $user) {
# Do nothing
}
elsif ($user =~ /^<(.*)>$/) {
($user, $host) = $class->canonify($user); ($user, $host) = $class->canonify($user);
return if !defined $user; return if !defined $user;
} }