avoid error about undefined array
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 12 May 2014 11:33:13 +0000 (13:33 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 13 May 2014 05:16:01 +0000 (07:16 +0200)
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
src/PVE/Firewall.pm

index 398a015..7e33a1e 100644 (file)
@@ -2357,7 +2357,7 @@ sub save_vmfw_conf {
     my $options = $vmfw_conf->{options};
     $raw .= &$format_options($options) if scalar(keys %$options);
 
-    my $rules = $vmfw_conf->{rules};
+    my $rules = $vmfw_conf->{rules} || [];
     if (scalar(@$rules)) {
        $raw .= "[RULES]\n\n";
        $raw .= &$format_rules($rules, 1);