From 042d7b34f071b219497ad52d8b5fb0c8ad735ca8 Mon Sep 17 00:00:00 2001 From: Koki Kato Date: Thu, 3 Dec 2020 01:02:12 +0900 Subject: [PATCH] cli: avoid nil dereference in silence update (#2427) Signed-off-by: Koki Kato --- cli/silence_update.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/silence_update.go b/cli/silence_update.go index 18046dee..99251c3b 100644 --- a/cli/silence_update.go +++ b/cli/silence_update.go @@ -64,10 +64,10 @@ func (c *silenceUpdateCmd) update(ctx context.Context, _ *kingpin.ParseContext) params := silence.NewGetSilenceParams() params.SilenceID = strfmt.UUID(silenceID) response, err := amclient.Silence.GetSilence(params) - sil := response.Payload if err != nil { return err } + sil := response.Payload if c.start != "" { startsAtTime, err := time.Parse(time.RFC3339, c.start) if err != nil {