]> git.proxmox.com Git - pve-network.git/commitdiff
subnets: avoid nested post-if in eval
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Nov 2023 13:08:00 +0000 (14:08 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 22 Nov 2023 13:08:00 +0000 (14:08 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Network/SDN/Subnets.pm

index 05d2de26c6016c490336b163bc160a14655787d3..b1885c5a0d8ddb0b7eb61ddf0b84f7a7e84f9e24 100644 (file)
@@ -399,8 +399,10 @@ sub del_ip {
        my $plugin = PVE::Network::SDN::Ipams::Plugin->lookup($plugin_config->{type});
        $plugin->del_ip($plugin_config, $subnetid, $subnet, $ip);
 
-       eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip) if $mac; };
-       warn $@ if $@;
+       if ($mac) {
+           eval { PVE::Network::SDN::Ipams::del_cache_mac_ip($mac, $ip) };
+           warn $@ if $@;
+       }
     }
 
     eval {