Commit ed7a8f71 authored by Volker Dobler's avatar Volker Dobler Committed by Brad Fitzpatrick

net/http: Fix nil pointer dereference in error case.

R=golang-dev
CC=bradfitz, golang-dev
https://golang.org/cl/5598044
parent dcbc77d2
......@@ -275,7 +275,7 @@ func (c *Client) Post(url string, bodyType string, body io.Reader) (r *Response,
}
req.Header.Set("Content-Type", bodyType)
r, err = send(req, c.Transport)
if c.Jar != nil {
if err == nil && c.Jar != nil {
c.Jar.SetCookies(req.URL, r.Cookies())
}
return r, err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment