From 8e30dec24f2b01556e958e313511d1564879ccb4 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sun, 8 Apr 2018 00:09:46 +0100 Subject: [PATCH] protect against undef mac (l.e. ferguson) --- lib/App/Netdisco/Util/Node.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/App/Netdisco/Util/Node.pm b/lib/App/Netdisco/Util/Node.pm index ca6d4eed..7cc832bc 100644 --- a/lib/App/Netdisco/Util/Node.pm +++ b/lib/App/Netdisco/Util/Node.pm @@ -65,6 +65,8 @@ MAC address does not belong to an interface on any known Device sub check_mac { my ($device, $node, $port_macs) = @_; + return 0 if !$device or !$node; + my $mac = NetAddr::MAC->new(mac => $node); my $devip = (ref $device ? $device->ip : ''); $port_macs ||= {};