From ac41143856530b1be64e7b8bd6deea3fa7e7d266 Mon Sep 17 00:00:00 2001 From: jbevain Date: Wed, 9 Dec 2009 19:19:59 +0000 Subject: [PATCH] 2009-12-09 Jb Evain * StringComparer.cs (GetHashCode): properly throw an ANE instead of an NRE. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mcs@147932 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- class/corlib/System/ChangeLog | 5 +++++ class/corlib/System/StringComparer.cs | 3 +++ 2 files changed, 8 insertions(+) diff --git a/class/corlib/System/ChangeLog b/class/corlib/System/ChangeLog index 4910af2913..400c671da2 100644 --- a/class/corlib/System/ChangeLog +++ b/class/corlib/System/ChangeLog @@ -1,3 +1,8 @@ +2009-12-09 Jb Evain + + * StringComparer.cs (GetHashCode): properly throw + an ANE instead of an NRE. + 2009-12-09 Miguel de Icaza * Enum.cs: Add new .NET 4.0 API. diff --git a/class/corlib/System/StringComparer.cs b/class/corlib/System/StringComparer.cs index 76216e9e40..a08bc51966 100644 --- a/class/corlib/System/StringComparer.cs +++ b/class/corlib/System/StringComparer.cs @@ -205,6 +205,9 @@ namespace System public override int GetHashCode (string s) { + if (s == null) + throw new ArgumentNullException ("s"); + if (_ignoreCase) return s.GetCaseInsensitiveHashCode (); else -- 2.11.4.GIT