about summary refs log tree commit homepage
path: root/lib/PublicInbox/WwwListing.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-08-27 22:03:02 +0000
committerEric Wong <e@80x24.org>2021-08-28 10:37:36 +0000
commitb587bfbcbff710dc9667af85be6a2a619f918273 (patch)
treedd64bb42efe61614880b3aada6eda12f07544ede /lib/PublicInbox/WwwListing.pm
parent733a7405f5a9d24782093876f178c6eb954dc17c (diff)
downloadpublic-inbox-b587bfbcbff710dc9667af85be6a2a619f918273.tar.gz
www: avoid potential auto-vivification on ibx->{url}
This may fix problems with the "all" link disappearing.

Link: https://public-inbox.org/meta/CAMwyc-Tw=v5yT1U1U66GSwwTK8OJXv8_YDu-=oXbZO3tHSnYWw@mail.gmail.com/
Diffstat (limited to 'lib/PublicInbox/WwwListing.pm')
-rw-r--r--lib/PublicInbox/WwwListing.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/WwwListing.pm b/lib/PublicInbox/WwwListing.pm
index 1bb5fbd0..ef9048b5 100644
--- a/lib/PublicInbox/WwwListing.pm
+++ b/lib/PublicInbox/WwwListing.pm
@@ -17,7 +17,7 @@ sub ibx_entry {
         my $desc = ascii_html($ce->{description} //= $ibx->description);
         my $ts = fmt_ts($ce->{-modified} //= $ibx->modified);
         my ($url, $href);
-        if (defined($ibx->{url})) {
+        if (scalar(@{$ibx->{url} // []})) {
                 $url = $href = ascii_html(prurl($ctx->{env}, $ibx->{url}));
         } else {
                 $href = ascii_html(uri_escape_utf8($ibx->{name})) . '/';
@@ -41,7 +41,7 @@ sub list_match_i { # ConfigIter callback
                 return if $section !~ m!\Apublicinbox\.([^/]+)\z!;
                 my $ibx = $cfg->lookup_name($1) or return;
                 if (!$ibx->{-hide}->{$ctx->hide_key} &&
-                                        grep(/$re/, @{$ibx->{url}})) {
+                                        grep(/$re/, @{$ibx->{url} // []})) {
                         $ctx->ibx_entry($ibx);
                 }
         } else { # undef == "EOF"