api: fix conditional variable declaration

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2020-10-16 17:51:05 +02:00
parent ca3ac88200
commit 11c601e9ad

View File

@ -1191,10 +1191,11 @@ my $update_vm_api = sub {
my $modified = {}; # record what $option we modify
my $bootcfg = PVE::JSONSchema::parse_property_string('pve-qm-boot', $conf->{boot})
if $conf->{boot};
my @bootorder = PVE::Tools::split_list($bootcfg->{order})
if $bootcfg && $bootcfg->{order};
my @bootorder;
if (my $boot = $conf->{boot}) {
my $bootcfg = PVE::JSONSchema::parse_property_string('pve-qm-boot', $boot);
@bootorder = PVE::Tools::split_list($bootcfg->{order}) if $bootcfg && $bootcfg->{order};
}
my $bootorder_deleted = grep {$_ eq 'bootorder'} @delete;
foreach my $opt (@delete) {