From 080c70430c1ce31017d2d78c887734ae13a1eded Mon Sep 17 00:00:00 2001 From: Joshua Powers Date: Thu, 5 Sep 2024 10:18:16 -0600 Subject: [PATCH] fix(inputs.snmp): Avoid sending a nil to gosmi's GetEnumBitsFormatted (#15743) --- internal/snmp/translator_gosmi.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/internal/snmp/translator_gosmi.go b/internal/snmp/translator_gosmi.go index dc9e10195b5b1..d6bfba91a0393 100644 --- a/internal/snmp/translator_gosmi.go +++ b/internal/snmp/translator_gosmi.go @@ -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 }