]> Sergey Matveev's repositories - public-inbox.git/commitdiff
search: gracefully handle lookup_message failure
authorEric Wong <e@80x24.org>
Sun, 14 Aug 2016 10:21:15 +0000 (10:21 +0000)
committerEric Wong <e@80x24.org>
Sun, 14 Aug 2016 10:25:58 +0000 (10:25 +0000)
We can't blindly assume a ghost even exists in the DB, as the
rules can change internally for some corner-case Message-IDs.

lib/PublicInbox/Search.pm

index 018fcb5537676ba6d9548f2c238451d317f8c1cd..1398ea4198432a9f1354f5cc66fe601702c6a454 100644 (file)
@@ -245,7 +245,7 @@ sub lookup_message {
 
 sub lookup_mail { # no ghosts!
        my ($self, $mid) = @_;
-       my $smsg = lookup_message($self, $mid);
+       my $smsg = lookup_message($self, $mid) or return;
        PublicInbox::SearchMsg->load_doc($smsg->{doc});
 }