Don't catch an ArgumentException just to get a NullReferenceException instead.
authorFrederik Carlier <frederik.carlier@quamotion.mobi>
Wed, 20 Sep 2017 17:49:34 +0000 (19:49 +0200)
committerFrederik Carlier <frederik.carlier@quamotion.mobi>
Thu, 21 Sep 2017 21:33:33 +0000 (23:33 +0200)
Commit migrated from https://github.com/dotnet/corefx/commit/e12abadaaed28128232e1972d1aa94a467ab11ac

src/libraries/System.Drawing.Common/tests/mono/System.Imaging/MetafileTest.cs

index be83850..3de8eb2 100644 (file)
@@ -460,14 +460,7 @@ namespace MonoTests.System.Drawing.Imaging
         [ConditionalFact(Helpers.GdiplusIsAvailable)]
         public void Measure()
         {
-            Font test_font = null;
-            try
-            {
-                test_font = new Font(FontFamily.GenericMonospace, 12);
-            }
-            catch (ArgumentException)
-            {
-            }
+            Font test_font = new Font(FontFamily.GenericMonospace, 12);
 
             Metafile mf;
             using (Bitmap bmp = new Bitmap(100, 100, PixelFormat.Format32bppArgb))