]> git.proxmox.com Git - pve-cluster.git/commitdiff
fix variable declared in conditional statement
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 27 Jan 2023 10:40:22 +0000 (11:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 27 Jan 2023 10:40:22 +0000 (11:40 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
data/PVE/Cluster.pm

index c521391f5af1d38dfb2715da44c95ccce24c1a33..0154aae09b346fa5a822d880908cae074c31c10e 100644 (file)
@@ -411,7 +411,7 @@ sub get_tasklist {
     foreach my $node (@$nodelist) {
        next if $nodename && ($nodename ne $node);
        eval {
-           my $ver = $kvstore->{$node}->{tasklist} if $kvstore->{$node};
+           my $ver = exists $kvstore->{$node} ? $kvstore->{$node}->{tasklist} : undef;
            my $cache = $tasklistcache->{$node};
            if (!$cache || !$ver || !$cache->{version} || ($cache->{version} != $ver)) {
                my $tasks = [];