X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FAddress.pm;h=f413c2f636b9af55dc815afda6936ceda5e05a28;hb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;hp=433b36ebb4ef4f38170d9ee6cb51972c12b9a6d3;hpb=69ae87044ca499aa401c73a9a1d764013539fb2d;p=public-inbox.git diff --git a/lib/PublicInbox/Address.pm b/lib/PublicInbox/Address.pm index 433b36eb..f413c2f6 100644 --- a/lib/PublicInbox/Address.pm +++ b/lib/PublicInbox/Address.pm @@ -1,15 +1,18 @@ -# Copyright (C) 2016-2019 all contributors +# Copyright (C) 2016-2020 all contributors # License: AGPL-3.0+ package PublicInbox::Address; use strict; use warnings; -sub xs_emails { map { $_->address() } parse_email_addresses($_[0]) } +sub xs_emails { + grep { defined } map { $_->address() } parse_email_addresses($_[0]) +} sub xs_names { - map { + grep { defined } map { my $n = $_->name; - $n = $_->user if $n eq $_->address; + my $addr = $_->address; + $n = $_->user if defined($addr) && $n eq $addr; $n; } parse_email_addresses($_[0]); }