[pve-devel] [PATCH pve-network 1/3] create api: test if $scfg vnet exist

Alexandre Derumier aderumier at odiso.com
Mon Jun 3 17:57:37 CEST 2019


---
 PVE/API2/Network/Network.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/PVE/API2/Network/Network.pm b/PVE/API2/Network/Network.pm
index 9c73d19..14d9903 100644
--- a/PVE/API2/Network/Network.pm
+++ b/PVE/API2/Network/Network.pm
@@ -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};
-- 
2.11.0




More information about the pve-devel mailing list