fix: Potential nil pointer dereference

This commit is contained in:
Manuel 2024-04-27 22:20:03 +02:00
parent 8f13f765a1
commit 7562b86894
Signed by: Manuel
GPG key ID: 4085037435E1F07A

View file

@ -96,10 +96,10 @@ func sendRequest(url string, data *Webhook) error {
} }
resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData)) resp, err := http.Post(url, "application/json", bytes.NewBuffer(jsonData))
defer resp.Body.Close()
if err != nil { if err != nil {
return err return err
} }
defer resp.Body.Close()
return nil return nil
} }