From 3e64a28248d554cabd688ebd3354f153524d293d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 14 Aug 2016 10:21:15 +0000 Subject: 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. --- lib/PublicInbox/Search.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/Search.pm') 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}); } -- cgit v1.2.3-24-ge0c7