unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] nntpd: skip inboxes w/o {newsgroup}
@ 2020-12-18 11:54 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2020-12-18 11:54 UTC (permalink / raw)
  To: meta

So we don't trigger an uninitialized variable warning :x
---
 lib/PublicInbox/NNTPD.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/NNTPD.pm b/lib/PublicInbox/NNTPD.pm
index 953228d0..7f9a1d58 100644
--- a/lib/PublicInbox/NNTPD.pm
+++ b/lib/PublicInbox/NNTPD.pm
@@ -38,8 +38,8 @@ sub refresh_groups {
 	my $groups = $pi_cfg->{-by_newsgroup}; # filled during each_inbox
 	$pi_cfg->each_inbox(sub {
 		my ($ibx) = @_;
-		my $ngname = $ibx->{newsgroup};
-		if (defined($ngname) && $ibx->nntp_usable) {
+		my $ngname = $ibx->{newsgroup} // return;
+		if ($ibx->nntp_usable) {
 			# only valid if msgmap and over works
 			# preload to avoid fragmentation:
 			$ibx->description;

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

only message in thread, other threads:[~2020-12-18 11:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-18 11:54 [PATCH] nntpd: skip inboxes w/o {newsgroup} 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).