fix(inputs.snmp): Avoid sending a nil to gosmi's GetEnumBitsFormatted (#15743)

This commit is contained in:
Joshua Powers 2024-09-05 10:18:16 -06:00 committed by GitHub
parent fc2d71474c
commit 83561960a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -54,9 +54,12 @@ func (g *gosmiTranslator) SnmpTable(oid string) (
}
func (g *gosmiTranslator) SnmpFormatEnum(oid string, value interface{}, full bool) (string, error) {
if value == nil {
return "", nil
}
//nolint:dogsled // only need to get the node
_, _, _, _, node, err := snmpTranslateCall(oid)
if err != nil {
return "", err
}