Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/class/corlib/System/Activator.cs')
-rw-r--r--mcs/class/corlib/System/Activator.cs14
1 files changed, 8 insertions, 6 deletions
diff --git a/mcs/class/corlib/System/Activator.cs b/mcs/class/corlib/System/Activator.cs
index 4727251d9e6..6cb4c24b262 100644
--- a/mcs/class/corlib/System/Activator.cs
+++ b/mcs/class/corlib/System/Activator.cs
@@ -168,9 +168,10 @@ namespace System
length = args.Length;
Type [] atypes = new Type [length];
- for (int i = 0; i < length; ++i) {
- atypes [i] = args [i].GetType ();
- }
+ for (int i = 0; i < length; ++i)
+ if (args [i] != null)
+ atypes [i] = args [i].GetType ();
+
ConstructorInfo ctor = type.GetConstructor (atypes);
if (ctor == null) {
if (type.IsValueType && atypes.Length == 0)
@@ -213,9 +214,10 @@ namespace System
length = args.Length;
Type[] atypes = new Type [length];
- for (int i = 0; i < length; ++i) {
- atypes [i] = args [i].GetType ();
- }
+ for (int i = 0; i < length; ++i)
+ if (args [i] != null)
+ atypes [i] = args [i].GetType ();
+
ConstructorInfo ctor = type.GetConstructor (bindingAttr, binder, atypes, null);
if (ctor == null) {
// Not sure about this