Skip to content

Commit 39ce2b0

Browse files
committed
Fix rare segfault on doDiscordReq
1 parent 26c626c commit 39ce2b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/discord.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,11 @@ func GetBotUser(token string) (*BotUserResponse, error) {
206206

207207
func doDiscordReq(ctx context.Context, path string, method string, body io.ReadCloser, header http.Header, query string) (*http.Response, error) {
208208
discordReq, err := http.NewRequestWithContext(ctx, method, "https://discord.com" + path + "?" + query, body)
209-
discordReq.Header = header
210209
if err != nil {
211210
return nil, err
212211
}
213212

213+
discordReq.Header = header
214214
startTime := time.Now()
215215
discordResp, err := client.Do(discordReq)
216216

0 commit comments

Comments
 (0)