]> Sergey Matveev's repositories - public-inbox.git/commitdiff
overidx: each_by_mid: account for messages being deleted
authorEric Wong <e@80x24.org>
Thu, 7 Oct 2021 08:29:32 +0000 (08:29 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Oct 2021 08:35:19 +0000 (08:35 +0000)
This may fix some extindex problems and should get rid of
the "Can't bless non-reference value" errors.

lib/PublicInbox/OverIdx.pm

index 0c8a4d9ee3f846d67cd514a41e1cbe8e916950be..985abbf4e693de8f01939556abca07504fa21eae 100644 (file)
@@ -158,7 +158,8 @@ SELECT $cols FROM over WHERE over.num = ? LIMIT 1
 
                foreach (@$nums) {
                        $sth->execute($_->[0]);
-                       my $smsg = $sth->fetchrow_hashref;
+                       # $cb may delete rows and invalidate nums
+                       my $smsg = $sth->fetchrow_hashref // next;
                        $smsg = PublicInbox::Over::load_from_row($smsg);
                        $cb->($self, $smsg, @arg) or return;
                }