From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 89AAF1F4B4 for ; Wed, 16 Dec 2020 23:56:29 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] inbox: ->uidvalidity returns undef w/o ->mm Date: Wed, 16 Dec 2020 23:56:29 +0000 Message-Id: <20201216235629.3282-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: While totally unindexed inboxes are rare, we still support them for v1 and may hit code which calls this method. Just return `undef' when ->mm access fails. --- lib/PublicInbox/Inbox.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index 586bd561..6811c456 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -431,7 +431,7 @@ sub on_unlock { } } -sub uidvalidity { $_[0]->{uidvalidity} //= $_[0]->mm->created_at } +sub uidvalidity { $_[0]->{uidvalidity} //= eval { $_[0]->mm->created_at } } sub eidx_key { $_[0]->{newsgroup} // $_[0]->{inboxdir} }