2005-09-21 Jordi Mas i Hernandez <jordi@ximian.com>
authorJordi Mas i Hernandez <jordi@mono-cvs.ximian.com>
Wed, 21 Sep 2005 10:28:17 +0000 (10:28 -0000)
committerJordi Mas i Hernandez <jordi@mono-cvs.ximian.com>
Wed, 21 Sep 2005 10:28:17 +0000 (10:28 -0000)
* Graphics.cs: Fixes exception type at FromImage method

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

mcs/class/System.Drawing/System.Drawing/ChangeLog
mcs/class/System.Drawing/System.Drawing/Graphics.cs
mcs/class/System.Drawing/Test/System.Drawing/TestGraphics.cs

index 40006a0445a5d88e3fbc9acbfacb645725442a80..dd3a8348543a1cc4ad034a71f0acf203c748b081 100644 (file)
@@ -1,3 +1,7 @@
+2005-09-21 Jordi Mas i Hernandez <jordi@ximian.com> 
+
+       * Graphics.cs: Fixes exception type at FromImage method
+
 2005-09-20 Vladimir Krasnov <vladimirk@mainsoft.com>
 
        * Graphics.jvm.cs: bitmap resolution fix in DrawImage
index 5e777899446d6513d25c2e48ea9aadc91bd22cf7..42b107c18b478a1d556dc7a4a516ee1f83661f0f 100644 (file)
@@ -1291,7 +1291,8 @@ namespace System.Drawing
                {
                        IntPtr graphics;
 
-                       if (image == null) throw new ArgumentException ();
+                       if (image == null) 
+                               throw new ArgumentNullException ();
 
                        Status status = GDIPlus.GdipGetImageGraphicsContext (image.nativeObject, out graphics);
                        GDIPlus.CheckStatus (status);
index 3fe66c6c80b2910379d38c2afc453fe8302e1ddc..b93688af1b4e03eebf661438e813e0e1ed19746d 100644 (file)
@@ -287,7 +287,6 @@ namespace MonoTests.System.Drawing
                        g.Dispose ();                   
                }
 
-
                [Test]
                public void LoadIndexed ()
                {
@@ -299,6 +298,13 @@ namespace MonoTests.System.Drawing
                        Image x = Image.FromStream (str);
                        Graphics g = Graphics.FromImage (x);
                }
+               
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void FromImage ()
+               {
+                       Graphics g = Graphics.FromImage (null);
+               }               
        }
 }