don't crash if we can't create the instance for some reason

This commit is contained in:
Michael Becker 2024-08-01 23:34:12 -04:00
parent a4762ad485
commit 00abda4138

View File

@ -25,10 +25,21 @@ 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);
if (m.ClassId == oms.GetGlobalIdentifier(parentClass))
ConcreteInstanceWrapper m = null;
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;