lib/PublicInbox/SearchIdx.pm | 10 +++++++--- diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm index d63dd7c742b4c21ef9420d810954df3e8332f45e..1142ca7a0f4c83a6aa4103edc79d91bd04944e5a 100644 --- a/lib/PublicInbox/SearchIdx.pm +++ b/lib/PublicInbox/SearchIdx.pm @@ -292,11 +292,15 @@ my $mid = $smsg->mid; my $mime = $smsg->{mime}; my $hdr = $mime->header_obj; my $refs = $hdr->header_raw('References'); - my @refs = $refs ? ($refs =~ /<([^>]+)>/g) : (); + my @refs = defined $refs ? ($refs =~ /<([^>]+)>/g) : (); my $irt = $hdr->header_raw('In-Reply-To'); if (defined $irt) { - $irt = mid_clean($irt); - $irt = undef if $mid eq $irt; + if ($irt eq '') { + $irt = undef; + } else { + $irt = mid_clean($irt); + $irt = undef if $mid eq $irt; + } } my $tid;