2005-03-31 Alp Toker <alp@atoker.com>
authorAlp Toker <alp@mono-cvs.ximian.com>
Thu, 31 Mar 2005 14:13:44 +0000 (14:13 -0000)
committerAlp Toker <alp@mono-cvs.ximian.com>
Thu, 31 Mar 2005 14:13:44 +0000 (14:13 -0000)
        * GCHandle.cs: Clearer ArgumentException text in the case of a
        null-valued IntPtr argument.

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

mcs/class/corlib/System.Runtime.InteropServices/ChangeLog
mcs/class/corlib/System.Runtime.InteropServices/GCHandle.cs

index ebd1f6eb94e299fd6d40fe75ff1254ff0e2226ff..f7de55f6b52c5c09bb36c2a992ea4f66fa9c4ef6 100644 (file)
@@ -1,3 +1,8 @@
+2005-03-31  Alp Toker  <alp@atoker.com>
+
+       * GCHandle.cs: Clearer ArgumentException text in the case of a
+       null-valued IntPtr argument.
+
 2005-03-04  Kazuki Oikawa  <kazuki@panicode.com>
 
        * _Exception.cs
index 9ec4f349da94f9c5154b1e2ef0924ca983b6ac03..a518558aa4b279d072147bcb243c966519294218 100755 (executable)
@@ -114,6 +114,8 @@ namespace System.Runtime.InteropServices
                
                public static explicit operator GCHandle(IntPtr value)
                {
+                       if (value == IntPtr.Zero)
+                               throw new ArgumentException ("GCHandle value cannot be zero");
                        if (!CheckCurrentDomain ((int)value))
                                throw new ArgumentException ("GCHandle value belongs to a different domain");
                        return new GCHandle (value);