Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

System.Drawing: Throw ArgumentNullException on Unix as well #24140

Merged
merged 2 commits into from
Sep 19, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: at some point it'd be good to go through and use nameof for args. That was previously done for most exceptions throughout the corefx codebase, but code ported to corefx since missed out on that. That's not needed for this PR, though.


Status status;
if (GDIPlus.RunningOnUnix())
Expand Down
2 changes: 1 addition & 1 deletion src/System.Drawing.Common/src/Unix/System.Drawing/Image.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down