Author: jbevain
Date: 2007-11-08 16:04:42 -0500 (Thu, 08 Nov 2007)
New Revision: 89254

Modified:
   trunk/mcs/class/System/System.Net/WebHeaderCollection_2_1.cs
Log:
protect against KeyNotFoundException

Modified: trunk/mcs/class/System/System.Net/WebHeaderCollection_2_1.cs
===================================================================
--- trunk/mcs/class/System/System.Net/WebHeaderCollection_2_1.cs        
2007-11-08 20:56:29 UTC (rev 89253)
+++ trunk/mcs/class/System/System.Net/WebHeaderCollection_2_1.cs        
2007-11-08 21:04:42 UTC (rev 89254)
@@ -59,7 +59,13 @@
                }
 
                public string this [string header] {
-                       get { return headers [header]; }
+                       get {
+                               string value;
+                               if (headers.TryGetValue (header, out value))
+                                       return value;
+
+                               return string.Empty;
+                       }
                        set { headers [header] = value; }
                }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to