Merge pull request #2720 from mono/fix-39325
[mono.git] / mcs / class / System / System.Net / IPAddress.cs
index 04bf42eb87ba4edc50fdde571452482fe4b81cad..0211ad308181abefb0f8463413f9ceb33604e351 100644 (file)
@@ -184,6 +184,9 @@ namespace System.Net {
 
                public static IPAddress Parse (string ipString)
                {
+            if (ipString == null)
+                throw new ArgumentNullException("ipString");
+
                        IPAddress ret;
                        if (TryParse (ipString, out ret))
                                return ret;
@@ -193,7 +196,10 @@ namespace System.Net {
                public static bool TryParse (string ipString, out IPAddress address)
                {
                        if (ipString == null)
-                               throw new ArgumentNullException ("ipString");
+                       {
+                               address = null;
+                               return false;
+                       }
 
                        if ((address = ParseIPV4 (ipString)) == null)
                                if ((address = ParseIPV6 (ipString)) == null)