unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] lei_to_mail: avoid uninitialized vars for l2m_progress
@ 2023-10-01 22:34 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-10-01 22:34 UTC (permalink / raw)
  To: meta

nr_write may be undef if nothing was written due to dedupe, but
with seen messages.
---
 lib/PublicInbox/LeiToMail.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index 98d0ac19..b9f28ee4 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -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);
 }

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-01 22:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 22:34 [PATCH] lei_to_mail: avoid uninitialized vars for l2m_progress Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).