use defined() to check fot undefined value
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 27 Feb 2014 11:54:11 +0000 (12:54 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 27 Feb 2014 11:54:11 +0000 (12:54 +0100)
PVE/Firewall.pm

index fde72fd..43b42a2 100644 (file)
@@ -736,7 +736,7 @@ sub ruleset_generate_rule {
     if ($rule->{dport}) {
        if ($rule->{proto} && $rule->{proto} eq 'icmp') {
            # Note: we use dport to store --icmp-type
-           die "unknown icmp-type '$rule->{dport}'\n" if !$icmp_type_names->{$rule->{dport}};
+           die "unknown icmp-type '$rule->{dport}'\n" if !defined($icmp_type_names->{$rule->{dport}});
            $cmd .= " -m icmp --icmp-type $rule->{dport}";
        } else {
            if ($rule->{nbdport} && $rule->{nbdport} > 1) {