diff --git a/service/alerting/common/helper.go b/service/alerting/common/helper.go index faf5e344..ecb8d5ed 100644 --- a/service/alerting/common/helper.go +++ b/service/alerting/common/helper.go @@ -77,7 +77,7 @@ func RetrieveChannel(ch *alerting.Channel) (*alerting.Channel, error) { return nil, fmt.Errorf("empty channel") } enabled := ch.Enabled - if ch.ID != "" { + if ch.ID != "" && ((ch.Email == nil && ch.Type == alerting.ChannelEmail) || (ch.Webhook == nil && ch.Type == alerting.ChannelWebhook)) { _, err := orm.Get(ch) if err != nil { return nil, err