PublicInbox::Config.pm::_fill() assumes that address is an array.
Therefore when handling an unset address use an array containing a
single string, instead of a single string.

Signed-off-by: "Eric W. Biederman" <[email protected]>
---

I accidentially created a public inbox without an address at some
point and had some nasty errors because the default value
we game to address is not an array.

 lib/PublicInbox/Inbox.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 617b692b14ca..002b980f4057 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -102,7 +102,7 @@ sub _set_limiter ($$$) {
 
 sub new {
        my ($class, $opts) = @_;
-       my $v = $opts->{address} ||= '[email protected]';
+       my $v = $opts->{address} ||= [ '[email protected]' ];
        my $p = $opts->{-primary_address} = ref($v) eq 'ARRAY' ? $v->[0] : $v;
        $opts->{domain} = ($p =~ /\@(\S+)\z/) ? $1 : 'localhost';
        my $pi_config = delete $opts->{-pi_config};
-- 
2.20.1

--
unsubscribe: one-click, see List-Unsubscribe header
archive: https://public-inbox.org/meta/

Reply via email to