fix null exception (#15628)

This commit is contained in:
PipoCanaja
2023-12-11 14:10:34 +01:00
committed by GitHub
parent 3a5a64d5c1
commit efd5eb2a40

View File

@@ -203,6 +203,10 @@ if (($device['os'] == 'routeros') && version_compare($device['version'], '7.7',
$lldp_array = SnmpQuery::hideMib()->walk('TPLINK-LLDPINFO-MIB::lldpNeighborInfoEntry')->table();
foreach ($lldp_array as $key => $lldp) {
if (! is_array($lldp['lldpNeighborPortIndexId'])) {
// code below will fail so no need to finish this loop occurence.
continue;
}
$IndexId = key($lldp['lldpNeighborPortIndexId']);
$local_ifName = $lldp['lldpNeighborPortId'][$IndexId];