From: Thomas Lamprecht Date: Wed, 22 Nov 2023 13:08:00 +0000 (+0100) Subject: subnets: avoid nested post-if in eval X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5469161c135c2179ac2ce26a3ef212016b7f581e;p=matthieu%2Fpve-network.git subnets: avoid nested post-if in eval Signed-off-by: Thomas Lamprecht --- diff --git a/src/PVE/Network/SDN/Subnets.pm b/src/PVE/Network/SDN/Subnets.pm index 05d2de2..b1885c5 100644 --- a/src/PVE/Network/SDN/Subnets.pm +++ b/src/PVE/Network/SDN/Subnets.pm @@ -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 {