From 999ed78aa714bf89f44c2ecc5547c563b6e8a3c2 Mon Sep 17 00:00:00 2001 From: Sebastien Pouliot Date: Sat, 11 Jun 2016 14:21:21 -0400 Subject: [PATCH] [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null (#3141) * [System.Net.Http] Fix CFNetworkHandler.CookieContainer not to return null This aligns the handler with the managed HttpClientHandler [1] and make it easier to switch between them without additional or conditional code. [1] https://github.com/mono/mono/blob/14f8acced5bbb2f6d55fb3e7800382700bcc65eb/mcs/class/System.Net.Http/System.Net.Http/HttpClientHandler.cs#L97 --- mcs/class/System.Net.Http/CFNetworkHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcs/class/System.Net.Http/CFNetworkHandler.cs b/mcs/class/System.Net.Http/CFNetworkHandler.cs index 2b9a54d7fdc..6daf9e10a27 100644 --- a/mcs/class/System.Net.Http/CFNetworkHandler.cs +++ b/mcs/class/System.Net.Http/CFNetworkHandler.cs @@ -100,7 +100,7 @@ namespace System.Net.Http public CookieContainer CookieContainer { get { - return cookies; + return cookies ?? (cookies = new CookieContainer ()); } set { EnsureModifiability (); -- 2.11.4.GIT