cli: avoid nil dereference in silence update (#2427)

Signed-off-by: Koki Kato <koki.kato1994@gmail.com>
This commit is contained in:
Koki Kato 2020-12-03 01:02:12 +09:00 committed by GitHub
parent c39b787800
commit 042d7b34f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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 {