Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 3c0149d

Browse files
zaytsev-victorjkotas
authored andcommitted
Fixed parameter validation for Delegate.CreateDelegate method. (#15196)
1 parent f2fbb1c commit 3c0149d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mscorlib/src/System/Delegate.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected unsafe Delegate(Type target, String method)
6565
if (target == null)
6666
throw new ArgumentNullException(nameof(target));
6767

68-
if (target.IsGenericType && target.ContainsGenericParameters)
68+
if (target.ContainsGenericParameters)
6969
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
7070

7171
if (method == null)
@@ -394,7 +394,7 @@ public static Delegate CreateDelegate(Type type, Type target, String method, boo
394394
throw new ArgumentNullException(nameof(type));
395395
if (target == null)
396396
throw new ArgumentNullException(nameof(target));
397-
if (target.IsGenericType && target.ContainsGenericParameters)
397+
if (target.ContainsGenericParameters)
398398
throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target));
399399
if (method == null)
400400
throw new ArgumentNullException(nameof(method));

0 commit comments

Comments
 (0)