]> Sergey Matveev's repositories - public-inbox.git/commitdiff
unsubscribe: archive_url may be undefined
authorEric Wong <e@80x24.org>
Wed, 15 Jun 2016 01:36:40 +0000 (01:36 +0000)
committerEric Wong <e@80x24.org>
Wed, 15 Jun 2016 01:36:40 +0000 (01:36 +0000)
We'll show a nasty warning in the UI instead of triggering
a perl warning about an undefined variable.

lib/PublicInbox/Unsubscribe.pm

index 239feea9d9311c9e496036e80354809b71aeb22c..79234aa170aeb20a6cae3b5eff03b4e7d475cae7 100644 (file)
@@ -158,7 +158,7 @@ sub archive_info {
        }
 
        # protocol-relative URL:  "//example.com/" => "https://example.com/"
-       if ($archive_url =~ m!\A//!) {
+       if ($archive_url && $archive_url =~ m!\A//!) {
                $archive_url = "$env->{'psgi.url_scheme'}:$archive_url";
        }