Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit e4c85be

Browse files
committed
Add guard clause when creating cookie jar
1 parent 4ae51af commit e4c85be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/wpxf/net/http_response.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def parse_typhoeus_response(res)
1515
self.body = res.body.nil? ? '' : res.body
1616
self.headers = res.headers
1717
self.timed_out = res.timed_out? || res.return_code == :couldnt_connect
18-
self.cookies = CookieJar.new.parse(res.headers['Set-Cookie'])
18+
self.cookies = CookieJar.new.parse(res.headers['Set-Cookie']) if res.headers
1919
end
2020

2121
# @return [Boolean] a boolean that indicates whether a request timed out.

0 commit comments

Comments
 (0)