cli: avoid nil dereference in silence update (#2427)
Signed-off-by: Koki Kato <koki.kato1994@gmail.com>
This commit is contained in:
parent
c39b787800
commit
042d7b34f0
|
@ -64,10 +64,10 @@ func (c *silenceUpdateCmd) update(ctx context.Context, _ *kingpin.ParseContext)
|
||||||
params := silence.NewGetSilenceParams()
|
params := silence.NewGetSilenceParams()
|
||||||
params.SilenceID = strfmt.UUID(silenceID)
|
params.SilenceID = strfmt.UUID(silenceID)
|
||||||
response, err := amclient.Silence.GetSilence(params)
|
response, err := amclient.Silence.GetSilence(params)
|
||||||
sil := response.Payload
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
sil := response.Payload
|
||||||
if c.start != "" {
|
if c.start != "" {
|
||||||
startsAtTime, err := time.Parse(time.RFC3339, c.start)
|
startsAtTime, err := time.Parse(time.RFC3339, c.start)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue