don't crash if we can't create the instance for some reason
This commit is contained in:
parent
a4762ad485
commit
00abda4138
@ -25,12 +25,23 @@ public abstract class ConcreteInstanceWrapper : InstanceWrapper
|
||||
if (methodType.IsAbstract)
|
||||
continue;
|
||||
|
||||
ConcreteInstanceWrapper m = (ConcreteInstanceWrapper)methodType.Assembly.CreateInstance(methodType.FullName, false, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, new object[] { methodInstance }, null, null);
|
||||
ConcreteInstanceWrapper m = null;
|
||||
try
|
||||
{
|
||||
m = (ConcreteInstanceWrapper)methodType.Assembly.CreateInstance(methodType.FullName, false, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, new object[] { methodInstance }, null, null);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
if (m != null)
|
||||
{
|
||||
if (m.ClassId == oms.GetGlobalIdentifier(parentClass))
|
||||
{
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user