From 8dbb867b65d8ffd8962f746bb84be0fd08d23420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Wei=C3=9Fe?= Date: Tue, 16 Apr 2024 11:07:24 +0200 Subject: [PATCH] cli: nil error results in empty error string --- cli/telemetry/errors.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/telemetry/errors.go b/cli/telemetry/errors.go index 8577acfa15..392574d177 100644 --- a/cli/telemetry/errors.go +++ b/cli/telemetry/errors.go @@ -2,7 +2,9 @@ package telemetry // classifyCmdErr maps errors to fixed strings to avoid leaking sensitive data inside error messages. func classifyCmdErr(e error) string { - _ = e + if e == nil { + return "" + } switch { default: return "unknown error"