fix to hopefully catch txrate and rate being scalar not list, as reported by inphobia

This commit is contained in:
Oliver Gorwits
2019-01-03 22:59:33 +00:00
parent 7811c32147
commit 1dc3e70e37

View File

@@ -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;