]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei_to_mail: avoid uninitialized vars for l2m_progress
authorEric Wong <e@80x24.org>
Sun, 1 Oct 2023 22:34:44 +0000 (22:34 +0000)
committerEric Wong <e@80x24.org>
Sun, 1 Oct 2023 22:41:51 +0000 (22:41 +0000)
nr_write may be undef if nothing was written due to dedupe, but
with seen messages.

lib/PublicInbox/LeiToMail.pm

index 98d0ac19207337b9a87e328ce6ca0edf0931793b..b9f28ee4b4f4ee790035ed454ffe14dc64465060 100644 (file)
@@ -798,7 +798,7 @@ sub wq_atexit_child {
        $lei->{ale}->git->async_wait_all;
        my ($nr_w, $nr_s) = delete(@$lei{qw(-nr_write -nr_seen)});
        delete $self->{wcb};
-       $nr_s or return;
+       (($nr_w //= 0) + ($nr_s //= 0)) or return;
        return if $lei->{early_mua} || !$lei->{-progress} || !$lei->{pkt_op_p};
        $lei->{pkt_op_p}->pkt_do('l2m_progress', $nr_w, $nr_s);
 }