Skip to content

Commit c101f1a

Browse files
Handle error even if the logger is nil (#72)
1 parent a045071 commit c101f1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

internal/notifier/notifier_webhook.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ func (c *WebhookNotifier) Notify(diff model.DiffCache, wg *sync.WaitGroup) {
6363
}
6464
response, err := c.HTTPClient.Do(&request)
6565
// Log if something went wrong while calling the webhook.
66-
if err != nil && c.Logger != nil {
67-
c.Logger.Printf("[%v] error: while calling webhook: %v\n", date, err)
66+
if err != nil {
67+
if c.Logger != nil {
68+
c.Logger.Printf("[%v] error: while calling webhook: %v\n", date, err)
69+
}
6870
return
6971
}
7072
defer response.Body.Close()

0 commit comments

Comments
 (0)