about summary refs log tree commit homepage
path: root/lib/PublicInbox/Inbox.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/Inbox.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/Inbox.pm')
-rw-r--r--lib/PublicInbox/Inbox.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index df140cac..b0bb9dcc 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -250,7 +250,8 @@ sub base_url {
         }
         # called from a non-PSGI environment (e.g. NNTP/POP3):
         $self->{-base_url} ||= do {
-                my $url = $self->{url}->[0] or return undef;
+                my $url = $self->{url} // return undef;
+                $url = $url->[0] // return undef;
                 # expand protocol-relative URLs to HTTPS if we're
                 # not inside a web server
                 $url = "https:$url" if $url =~ m!\A//!;