Skip to content

Commit cf05936

Browse files
authored
Avoid NPE when populating headers with nil response (#179)
1 parent ac25fae commit cf05936

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func (c *Client) doRequest(
443443

444444
resp := c.doHttpRequest(ctx, reqReader)
445445

446-
if options != nil && options.headers != nil {
446+
if options != nil && options.headers != nil && resp.response != nil {
447447
for key, values := range resp.response.Header {
448448
for _, value := range values {
449449
options.headers.Add(key, value)

0 commit comments

Comments
 (0)