Skip to content

Commit

Permalink
#208 better null handling when reading cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
tmenier committed Sep 3, 2017
1 parent 8556164 commit 45f5514
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Flurl.Http/FlurlRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ private void WriteRequestCookies(HttpRequestMessage request) {
}

private void ReadResponseCookies(HttpResponseMessage response) {
if (response?.RequestMessage == null) return;

var uri = response.RequestMessage.RequestUri;
var uri = response?.RequestMessage?.RequestUri;
if (uri == null)
return;

// if the handler is an HttpClientHandler (which it usually is), it's already plucked the
// cookies out of the headers and put them in the CookieContainer.
Expand Down

0 comments on commit 45f5514

Please sign in to comment.