]> Sergey Matveev's repositories - public-inbox.git/commitdiff
nntpd: skip inboxes w/o {newsgroup}
authorEric Wong <e@80x24.org>
Fri, 18 Dec 2020 11:54:37 +0000 (11:54 +0000)
committerEric Wong <e@80x24.org>
Fri, 18 Dec 2020 20:53:43 +0000 (20:53 +0000)
So we don't trigger an uninitialized variable warning :x

lib/PublicInbox/NNTPD.pm

index 953228d0287823ea691e461fb5fae5b86f8c6e99..7f9a1d58558fb963707bd191dfa96107d6dd5dd5 100644 (file)
@@ -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;