From 839b3f8ac96da663d8a5b9aaeb4db5d40a458f75 Mon Sep 17 00:00:00 2001 From: matteo Date: Sat, 7 Feb 2015 17:13:56 +0200 Subject: fixed warning on comparison with uninitialized vars (sub get_net_zone_interfaces) --- lib/AdminPanel/Shared/Shorewall.pm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/AdminPanel/Shared/Shorewall.pm') diff --git a/lib/AdminPanel/Shared/Shorewall.pm b/lib/AdminPanel/Shared/Shorewall.pm index 77c6776f..eb08fa88 100644 --- a/lib/AdminPanel/Shared/Shorewall.pm +++ b/lib/AdminPanel/Shared/Shorewall.pm @@ -69,8 +69,15 @@ sub dev_to_shorewall { sub get_net_zone_interfaces { my ($interfacesfile, $_net, $all_intf) = @_; - #- read shorewall configuration first - my @interfaces = map { $_->[1] } grep { $_->[0] eq 'net' } $interfacesfile; + if(ref($interfacesfile) eq "ARRAY") + { + #- read shorewall configuration first + my @interfaces = map { $_->[1] } grep { $_->[0] eq 'net' } $interfacesfile; + } + else + { + my @interfaces = undef; + } #- else try to find the best interface available @interfaces ? @interfaces : @{$all_intf || []}; } -- cgit v1.2.1