2008-03-21 Sebastien Pouliot <sebastien@ximian.com>
authorSebastien Pouliot <sebastien@ximian.com>
Fri, 21 Mar 2008 14:42:08 +0000 (14:42 -0000)
committerSebastien Pouliot <sebastien@ximian.com>
Fri, 21 Mar 2008 14:42:08 +0000 (14:42 -0000)
* EqualityComparer.cs: Add null checks in GetHashCode. Fix bug
#372892

svn path=/trunk/mcs/; revision=98739

mcs/class/corlib/System.Collections.Generic/ChangeLog
mcs/class/corlib/System.Collections.Generic/EqualityComparer.cs

index ba3e1a1d6dffe5c94b5f742c78ac96eafab75389..a7d0bffb93c73067ec5b5e8a26ab393b2cdd7056 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-21  Sebastien Pouliot  <sebastien@ximian.com>
+
+       * EqualityComparer.cs: Add null checks in GetHashCode. Fix bug 
+       #372892
+
 2007-11-05  Sebastien Pouliot  <sebastien@ximian.com>
 
        * Dictionary.cs: Ensure that the non-generic CopyTo works on Array.
index a36424d27e2f53ba0dd00455c63065f3983eefdd..eceb5d095e6002bc240986d03bf8c11fc1413f3b 100644 (file)
@@ -69,6 +69,8 @@ namespace System.Collections.Generic {
        
                        public override int GetHashCode (T obj)
                        {
+                               if (obj == null)
+                                       return 0;
                                return obj.GetHashCode ();
                        }
        
@@ -87,6 +89,8 @@ namespace System.Collections.Generic {
 
                public override int GetHashCode (T obj)
                {
+                       if (obj == null)
+                               return 0;
                        return obj.GetHashCode ();
                }