fixup! Don't crash on non-existent path values

This commit is contained in:
Pranshu Srivastava 2023-02-17 18:12:22 +05:30 committed by Manuel Rüger
parent 63d2138ee4
commit 08c4765d5f
1 changed files with 1 additions and 1 deletions

View File

@ -434,7 +434,7 @@ func (c compiledGauge) value(it interface{}) (*eachValue, error) {
if it == nil { if it == nil {
return nil, fmt.Errorf("got nil while resolving path") return nil, fmt.Errorf("got nil while resolving path")
} }
// Don't error if there was not a type-casting issue (`toFloat64`), but rather a failed lookup. // Don't error if there was not a type-casting issue (`toFloat64`).
return nil, nil return nil, nil
} }
value, err := toFloat64(got, c.NilIsZero) value, err := toFloat64(got, c.NilIsZero)