]> git.proxmox.com Git - pve-storage.git/commitdiff
get_bandwidt_limits: ignore 'undef' as storage
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 5 Apr 2019 14:33:34 +0000 (16:33 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 5 Apr 2019 16:15:01 +0000 (18:15 +0200)
If one of the storages passed in $storage_list was not defined
get_bandwidth_limit died (see [0], of an occurence of this).
This patch changes the behavior to ignore undef as storage instead.

[0] https://pve.proxmox.com/pipermail/pve-devel/2019-April/036515.html

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/Storage.pm

index 0559538f1813966f90fcb7a5a5653aafdbe8a203..eb5e86ff830c1e11960d83c8ed4c5a08bcf9ccfc 100755 (executable)
@@ -1646,6 +1646,7 @@ sub get_bandwidth_limit {
 
        my %done;
        foreach my $storage (@$storage_list) {
+           next if !defined($storage);
            # Avoid duplicate checks:
            next if $done{$storage};
            $done{$storage} = 1;