]> Sergey Matveev's repositories - public-inbox.git/commitdiff
inbox: ->uidvalidity returns undef w/o ->mm
authorEric Wong <e@80x24.org>
Wed, 16 Dec 2020 23:56:29 +0000 (23:56 +0000)
committerEric Wong <e@80x24.org>
Thu, 17 Dec 2020 10:02:35 +0000 (10:02 +0000)
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

index 4e3c23f35a4820e96d87cb8f4b2c0f048ef9f5b0..bd1de0a004000b96121946fd863b777c37f4d1ee 100644 (file)
@@ -426,7 +426,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} }