-
Notifications
You must be signed in to change notification settings - Fork 48
Open
Description
Hi,
please consider the following patch to resolve() which just initializes @Result to an empty list which is then pushd to by the code. That way, the extra logic at the end of the function can go since we never return an undefined value
diff --git a/src/ferm b/src/ferm
index dc29ef0..72f0bf4 100755
--- a/src/ferm
+++ b/src/ferm
@@ -1320,7 +1320,7 @@ sub resolve($@) {
$type = ($domain eq 'ip6') ? 'AAAA' : 'A'
unless $type;
- my @result;
+ my @result = ();
foreach my $hostname (@names) {
my $numeric_type = identify_numeric_address($hostname);
if (defined $numeric_type) {
@@ -1360,9 +1360,6 @@ sub resolve($@) {
@result = resolve($domain, \@result, undef)
if $type eq 'NS' or $type eq 'MX';
- # if there are no records, return an empty array instead of "undefined"
- return [] unless length @result;
-
return @result;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels