]> git.proxmox.com Git - pve-common.git/commitdiff
get_options: avoid warning for -list format
authorDietmar Maurer <dietmar@proxmox.com>
Fri, 4 Sep 2015 06:52:57 +0000 (08:52 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Fri, 4 Sep 2015 06:52:57 +0000 (08:52 +0200)
src/PVE/JSONSchema.pm

index 47aa2780ca9e356f382babfdf1ad10975c7261f0..32d461cbf6467e6ad7adbdd86b650df79e7f7228 100644 (file)
@@ -1139,7 +1139,7 @@ sub get_options {
                if ($pd->{format} =~ m/-list/) {
                    # allow --vmid 100 --vmid 101 and --vmid 100,101
                    # allow --dow mon --dow fri and --dow mon,fri
                if ($pd->{format} =~ m/-list/) {
                    # allow --vmid 100 --vmid 101 and --vmid 100,101
                    # allow --dow mon --dow fri and --dow mon,fri
-                   $opts->{$p} = join(",", @{$opts->{$p}});
+                   $opts->{$p} = join(",", @{$opts->{$p}}) if ref($opts->{$p}) eq 'ARRAY';
                } elsif ($pd->{format} =~ m/-alist/) {
                    # we encode array as \0 separated strings
                    # Note: CGI.pm also use this encoding
                } elsif ($pd->{format} =~ m/-alist/) {
                    # we encode array as \0 separated strings
                    # Note: CGI.pm also use this encoding