diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/PublicInbox/Search.pm | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/Search.pm b/lib/PublicInbox/Search.pm index 24600ee7..a4e2498e 100644 --- a/lib/PublicInbox/Search.pm +++ b/lib/PublicInbox/Search.pm @@ -417,6 +417,11 @@ sub each_smsg_by_mid { my $term = 'Q' . $mid; my $head = $db->postlist_begin($term); my $tail = $db->postlist_end($term); + if ($head == $tail) { + $db->reopen; + $head = $db->postlist_begin($term); + $tail = $db->postlist_end($term); + } return ($head, $tail, $db) if wantarray; for (; $head->nequal($tail); $head->inc) { my $doc_id = $head->get_docid; |