From: Eric Wong Date: Sun, 14 Aug 2016 10:21:15 +0000 (+0000) Subject: search: gracefully handle lookup_message failure X-Git-Tag: v1.0.0~230 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3e64a28248d554cabd688ebd3354f153524d293d;p=public-inbox.git search: gracefully handle lookup_message failure We can't blindly assume a ghost even exists in the DB, as the rules can change internally for some corner-case Message-IDs. --- diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 018fcb55..1398ea41 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -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}); }