Fix php issue in cisco ntp code (#16172)

index does not exist error
This commit is contained in:
Tony Murray
2024-07-02 09:21:19 -05:00
committed by GitHub
parent cca35fcb61
commit 0cee13c831

View File

@@ -22,10 +22,9 @@ $options = [];
$options['filter']['type'] = ['=', $tmp_module];
$options['filter']['disabled'] = ['=', 0];
$options['filter']['ignore'] = ['=', 0];
$components = $component->getComponents($device['device_id'], $options);
// We only care about our device id.
$components = $components[$device['device_id']];
$components = $component->getComponents($device['device_id'], $options)[$device['device_id']] ?? null;
// Only collect SNMP data if we have enabled components
if (is_array($components) && count($components) > 0) {