diff --git a/Editor/Meta/GenericClass.cs b/Editor/Meta/GenericClass.cs index d10c16e..746b7aa 100644 --- a/Editor/Meta/GenericClass.cs +++ b/Editor/Meta/GenericClass.cs @@ -1,6 +1,7 @@ using dnlib.DotNet; using System.Collections.Generic; using System.Linq; +using UnityEngine; namespace HybridCLR.Editor.Meta { @@ -61,6 +62,11 @@ namespace HybridCLR.Editor.Meta return null; } TypeDef def = type.ResolveTypeDef(); + if (def == null) + { + Debug.LogError($"type:{type} ResolveTypeDef() == null"); + return null; + } var klassInst = ctx != null ? sig.GenericArguments.Select(ga => MetaUtil.Inflate(ga, ctx)).ToList() : sig.GenericArguments.ToList(); return new GenericClass(def, klassInst); } diff --git a/Editor/Meta/GenericMethod.cs b/Editor/Meta/GenericMethod.cs index 9989209..a725db7 100644 --- a/Editor/Meta/GenericMethod.cs +++ b/Editor/Meta/GenericMethod.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Linq; +using UnityEngine; namespace HybridCLR.Editor.Meta { @@ -87,6 +88,7 @@ namespace HybridCLR.Editor.Meta methodDef = method.ResolveMethodDef(); if (methodDef == null) { + Debug.LogError($"method:{method} ResolveMethodDef() == null"); return null; } if (method is MethodSpec methodSpec)