don't crash if we can't create the instance for some reason
This commit is contained in:
parent
a4762ad485
commit
00abda4138
@ -24,11 +24,22 @@ public abstract class ConcreteInstanceWrapper : InstanceWrapper
|
|||||||
{
|
{
|
||||||
if (methodType.IsAbstract)
|
if (methodType.IsAbstract)
|
||||||
continue;
|
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;
|
||||||
if (m.ClassId == oms.GetGlobalIdentifier(parentClass))
|
try
|
||||||
{
|
{
|
||||||
return m;
|
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;
|
return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user