Skip to content

Commit 68a8dc4

Browse files
committed
fixed an issue that was causing NPEs at 3 am
1 parent 62676a3 commit 68a8dc4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

logging.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ func sendFile(content []byte) {
7878
// Execute the request
7979
client := &http.Client{}
8080
response, err := client.Do(request)
81-
response.Body.Close()
8281

8382
if err != nil {
8483
fmt.Println(time.Now().Format("2006/01/02 15:04:05 "), "\033[1m\033[31m[ERROR] \033[0m| ", err)
8584
return
8685
}
86+
87+
response.Body.Close()
8788
}
8889

8990
func sendHook(ping bool, content ...interface{}) {
@@ -274,4 +275,3 @@ func SuccessWithAttachment(attachment []byte, v ...interface{}) {
274275
}()
275276
}
276277
}
277-

0 commit comments

Comments
 (0)