From db494007f272147c3a7f858ad44aab6bfb5f8525 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 f099603e3..2c5272e90 100644 --- a/cli/telemetry/errors.go +++ b/cli/telemetry/errors.go @@ -2,7 +2,9 @@ package telemetry // Map 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"