Skip to content

Commit 8fd218c

Browse files
committed
fix: webhook notificator: fix null ptr
1 parent aae76ec commit 8fd218c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

notificators/webhook/webhook.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ func (d *Webhook) Send(msg string) error {
116116
if d.verbose {
117117
d.logger.Println(err)
118118
}
119-
}
120-
121-
statusOK := resp.StatusCode >= 200 && resp.StatusCode < 300
122-
if !statusOK {
123-
if d.verbose {
124-
d.logger.Printf("notificator %s error: %s\n", d.Provider(), httpx.ErrorStatusNot200)
119+
} else {
120+
statusOK := resp.StatusCode >= 200 && resp.StatusCode < 300
121+
if !statusOK {
122+
if d.verbose {
123+
d.logger.Printf("notificator %s error: %s\n", d.Provider(), httpx.ErrorStatusNot200)
124+
}
125125
}
126126
}
127127
}(conf.webhookURL, bytes.NewBuffer(messageJSON), conf.headers, 5, d)

0 commit comments

Comments
 (0)