about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/Address.pm7
-rw-r--r--lib/PublicInbox/View.pm2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/PublicInbox/Address.pm b/lib/PublicInbox/Address.pm
index a5902cfd..3a59945c 100644
--- a/lib/PublicInbox/Address.pm
+++ b/lib/PublicInbox/Address.pm
@@ -19,8 +19,11 @@ sub xs_names {
 }
 
 sub xs_pairs { # for JMAP, RFC 8621 section 4.1.2.3
-        [ map { # LHS (name) may be undef
-                [ $_->phrase // $_->comment, $_->address ]
+        [ map { # LHS (name) may be undef if there's an address
+                my @p = ($_->phrase // $_->comment, $_->address);
+                # show original if totally bogus:
+                $p[0] = $_->original unless defined $p[1];
+                \@p;
         } parse_email_addresses($_[0]) ];
 }
 
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 39ec35c3..9d4262c1 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -230,7 +230,7 @@ sub to_cc_html ($$$$) {
                         }
                 }
                 $line_len += length($n);
-                $url = $addr2url->{lc $pair->[1]};
+                $url = $addr2url->{lc($pair->[1] // '')};
                 $html .= $url ? qq(<a\nhref="$url$t">$n</a>) : $n;
         }
         ($html, $len + $line_len);