]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: do not fail on empty In-Reply-To
authorEric Wong <e@80x24.org>
Thu, 4 Aug 2016 21:58:40 +0000 (21:58 +0000)
committerEric Wong <e@80x24.org>
Thu, 4 Aug 2016 21:58:51 +0000 (21:58 +0000)
Sometimes messages have an empty In-Reply-To header which throws
threaders off.  This actually causes public-inbox-httpd to die,
which is probably bad and will be fixed elsewhere.

lib/PublicInbox/View.pm

index e0d81f0029b9c1a1f5584eb6cf76578b74302f5c..db0cdc0ee14ef29033c5747dd43669496d4fcb62 100644 (file)
@@ -94,7 +94,7 @@ sub in_reply_to {
        my ($hdr) = @_;
        my $irt = $hdr->header_raw('In-Reply-To');
 
-       return mid_clean($irt) if (defined $irt);
+       return mid_clean($irt) if defined $irt && $irt ne '';
 
        my $refs = $hdr->header_raw('References');
        if ($refs && $refs =~ /<([^>]+)>\s*\z/s) {