mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
Weaver.ImportCorLibType: avoid MixIn exception when calling ImportReference with a null type. Log the type that we failed to resolve instead.
This commit is contained in:
parent
286983a8f8
commit
eb4b2f40c5
@ -262,7 +262,12 @@ static void SetupCorLib()
|
||||
static TypeReference ImportCorLibType(string fullName)
|
||||
{
|
||||
TypeDefinition type = CorLibModule.GetType(fullName) ?? CorLibModule.ExportedTypes.First(t => t.FullName == fullName).Resolve(0);
|
||||
return CurrentAssembly.MainModule.ImportReference(type);
|
||||
if (type != null)
|
||||
{
|
||||
return CurrentAssembly.MainModule.ImportReference(type);
|
||||
}
|
||||
Error("Failed to import mscorlib type: " + fullName + " because Resolve failed. (Might happen when trying to Resolve in NetStandard dll, see also: https://github.com/vis2k/Mirror/issues/791)");
|
||||
return null;
|
||||
}
|
||||
|
||||
static void SetupTargetTypes()
|
||||
|
Loading…
Reference in New Issue
Block a user