From 7a004a6f7f47fa5d17e855eb02650754d8411574 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 19 Apr 2023 17:08:36 +0400 Subject: [PATCH] fix: parse errors correctly Message metadata might be missing, the easiest usecase is contacting worker directly using it both as an endpoint and a node. Fixes #7108 Signed-off-by: Andrey Smirnov --- cmd/talosctl/pkg/talos/helpers/checks.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/talosctl/pkg/talos/helpers/checks.go b/cmd/talosctl/pkg/talos/helpers/checks.go index 1581ff854..6602f234a 100644 --- a/cmd/talosctl/pkg/talos/helpers/checks.go +++ b/cmd/talosctl/pkg/talos/helpers/checks.go @@ -38,7 +38,7 @@ func CheckErrors[T interface{ GetMetadata() *common.Metadata }](messages ...T) e for _, msg := range messages { md := msg.GetMetadata() - if md.Error != "" { + if md != nil && md.Error != "" { err = AppendErrors(err, fmt.Errorf(md.Error)) } }