From 6eefcf648b2d1acc7af6978fcfb18a40da78900a Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Mon, 21 Apr 2014 21:18:26 +0000 Subject: [PATCH] fix bug with undef vals in hosts struct --- Netdisco/lib/App/Netdisco/Util/DNS.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Netdisco/lib/App/Netdisco/Util/DNS.pm b/Netdisco/lib/App/Netdisco/Util/DNS.pm index 9441db6f..eb32361e 100644 --- a/Netdisco/lib/App/Netdisco/Util/DNS.pm +++ b/Netdisco/lib/App/Netdisco/Util/DNS.pm @@ -103,14 +103,13 @@ addresses which resolved. sub hostnames_resolve_async { my $ips = shift; - my $resolver = AnyEvent::DNS->new(); my %HOSTS = (); - $HOSTS{$_} = [ map { [ format_address $_->[0] ] } + $HOSTS{$_} = [ map { [ $_ ? (format_address $_->[0]) : '' ] } @{$AnyEvent::DNS::EtcHosts::HOSTS{$_}} ] for keys %AnyEvent::DNS::EtcHosts::HOSTS; - + # Set up the condvar my $done = AE::cv; $done->begin( sub { shift->send } );