From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C1D4B1F4B4 for ; Fri, 18 Dec 2020 11:54:37 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] nntpd: skip inboxes w/o {newsgroup} Date: Fri, 18 Dec 2020 11:54:37 +0000 Message-Id: <20201218115437.23714-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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;