From 1dc3e70e37e0eadc1d3b51953d7598200b0de2a3 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Thu, 3 Jan 2019 22:59:33 +0000 Subject: [PATCH] fix to hopefully catch txrate and rate being scalar not list, as reported by inphobia --- lib/App/Netdisco/Worker/Plugin/Macsuck/WirelessNodes.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/App/Netdisco/Worker/Plugin/Macsuck/WirelessNodes.pm b/lib/App/Netdisco/Worker/Plugin/Macsuck/WirelessNodes.pm index 44c7d5b5..454bc4c3 100644 --- a/lib/App/Netdisco/Worker/Plugin/Macsuck/WirelessNodes.pm +++ b/lib/App/Netdisco/Worker/Plugin/Macsuck/WirelessNodes.pm @@ -41,11 +41,11 @@ register_worker({ phase => 'main', driver => 'snmp' }, sub { next unless defined $mac; # avoid null entries # there can be more rows in txrate than other tables - my $txrate = defined $txrates->[$#$txrates] + my $txrate = (ref $txrates and defined $txrates->[$#$txrates]) ? int($txrates->[$#$txrates]) : undef; - my $maxrate = defined $rates->[$#$rates] + my $maxrate = (ref $rates and defined $rates->[$#$rates]) ? int($rates->[$#$rates]) : undef;