From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2F15C1F6C1 for ; Sun, 14 Aug 2016 10:27:41 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] search: gracefully handle lookup_message failure Date: Sun, 14 Aug 2016 10:27:41 +0000 Message-Id: <20160814102741.19092-1-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 018fcb5..1398ea4 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}); } -- EW