From 415249bafb74d13f68ce0c0db02641d5cb30c7e6 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 6 Sep 2017 11:49:11 +0200 Subject: [PATCH 1/2] Throw ArgumentNullException when stream is null --- .../src/Unix/System.Drawing.Imaging/Metafile.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Drawing.Common/src/Unix/System.Drawing.Imaging/Metafile.cs b/src/System.Drawing.Common/src/Unix/System.Drawing.Imaging/Metafile.cs index d7d81ee9a2b5..2b2e69fb9ba0 100644 --- a/src/System.Drawing.Common/src/Unix/System.Drawing.Imaging/Metafile.cs +++ b/src/System.Drawing.Common/src/Unix/System.Drawing.Imaging/Metafile.cs @@ -68,7 +68,7 @@ internal Metafile(IntPtr ptr, Stream stream) public Metafile(Stream stream) { if (stream == null) - throw new ArgumentException("stream"); + throw new ArgumentNullException("stream"); Status status; if (GDIPlus.RunningOnUnix()) From 3bb0a3f2753b1c3c4979c9c619e81d9681b8a795 Mon Sep 17 00:00:00 2001 From: Frederik Carlier Date: Wed, 6 Sep 2017 11:47:38 +0200 Subject: [PATCH 2/2] Throw ArgumentNullException when stream is null --- src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs b/src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs index 7c8d2cb645cb..79ebf13644ee 100644 --- a/src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs +++ b/src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs @@ -283,7 +283,7 @@ public static bool IsExtendedPixelFormat(PixelFormat pixfmt) internal static IntPtr InitFromStream(Stream stream) { if (stream == null) - throw new ArgumentException("stream"); + throw new ArgumentNullException(nameof(stream)); IntPtr imagePtr; Status st;