]> git.proxmox.com Git - pve-manager-legacy.git/commitdiff
NodeConfig/get_acme_conf: make domains always a hash
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 7 May 2020 08:27:07 +0000 (10:27 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 7 May 2020 10:54:30 +0000 (12:54 +0200)
on all call sites, we assume $cfg->{domains} is a hash, but if we do not
have any domains configured, that fails with
'Can't use an undefined value as a HASH reference at ...'

so always make domains a hash to avoid this

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/NodeConfig.pm

index 2de9015e46e8c9b006832439597159a049d333c0..af726b1564846a3f8180145c0d4b80878823cb18 100644 (file)
@@ -251,6 +251,7 @@ sub get_acme_conf {
            die $err;
        }
        my $standalone_domains = delete($res->{domains}) // '';
+       $res->{domains} = {};
        for my $domain (split(";", $standalone_domains)) {
            $res->{domains}->{$domain}->{plugin} = 'standalone';
            $res->{domains}->{$domain}->{_configkey} = 'acme';