fix(inputs.snmp): Avoid sending a nil to gosmi's GetEnumBitsFormatted (#15743)
This commit is contained in:
parent
fc2d71474c
commit
83561960a5
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue