]> git.proxmox.com Git - pve-network.git/commitdiff
create api: test if $scfg vnet exist
authorAlexandre Derumier <aderumier@odiso.com>
Mon, 3 Jun 2019 15:57:37 +0000 (17:57 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 4 Jun 2019 04:06:52 +0000 (06:06 +0200)
PVE/API2/Network/Network.pm

index 9c73d19af013abb82b73a01975c71e0f66a0e565..14d9903c028c649cc41c635c3cbdbb9d3742a36d 100644 (file)
@@ -139,7 +139,7 @@ __PACKAGE__->register_method ({
                $cfg->{ids}->{$networkid} = $opts;
                $plugin->on_update_hook($networkid, $cfg);
                #also verify transport associated to vnet
-               if($scfg->{type} eq 'vnet') {
+               if($scfg && $scfg->{type} eq 'vnet') {
                    my $transportid = $scfg->{transportzone};
                    die "missing transportzone" if !$transportid;
                    my $transport_cfg = $cfg->{ids}->{$transportid};