about summary refs log tree commit homepage
path: root/lib/PublicInbox/SearchIdx.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/SearchIdx.pm')
-rw-r--r--lib/PublicInbox/SearchIdx.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index d63dd7c7..1142ca7a 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -292,11 +292,15 @@ sub link_message {
         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;