From 3fe743359bea26900fbf6cd07873abc523941d1e Mon Sep 17 00:00:00 2001 From: Hugh Bellamy Date: Sat, 17 Jun 2017 17:49:26 +0700 Subject: [PATCH] Throw ArgumentNullException on Unix calling Marshal.IsComObject(null) (dotnet/coreclr#12348) Commit migrated from https://github.com/dotnet/coreclr/commit/a6ed71c6472c8ea0f680507ae34f56aeaf6bb3d2 --- .../src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs index c79af8b..59229ed 100644 --- a/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs +++ b/src/coreclr/src/mscorlib/src/System/Runtime/InteropServices/NonPortable.cs @@ -153,7 +153,12 @@ namespace System.Runtime.InteropServices } public static bool IsComObject(object o) - { + { + if (o == null) + { + throw new ArgumentNullException(nameof(o)); + } + return false; } -- 2.7.4