[HttpWebRequest] Avoid nullref on empty cookie header.
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 13 Feb 2011 19:53:08 +0000 (14:53 -0500)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Sun, 13 Feb 2011 19:53:59 +0000 (14:53 -0500)
If the Set-Cookie header is empty, the cookie instance is not created.
Fixes bug #670189.

mcs/class/System/System.Net/HttpWebResponse.cs

index 9747da9d512041fb0cab13c6c03b9e0621ade242..0a542bf2d6a1ae7dfbae50f46e9461ba206552e8 100644 (file)
@@ -421,6 +421,9 @@ namespace System.Net
                                }
                        }
 
+                       if (cookie == null)
+                               return;
+
                        if (cookieCollection == null)
                                cookieCollection = new CookieCollection ();