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()) 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;