AppModel: Don't crash on MetadataUsage MethodDef/Ref without prior method definition
This commit is contained in:
@@ -211,6 +211,12 @@ namespace Il2CppInspector.Model
|
||||
declarationGenerator.IncludeMethod(method);
|
||||
AddTypes(declarationGenerator.GenerateRemainingTypeDeclarations());
|
||||
|
||||
// Any method here SHOULD already be in the Methods list
|
||||
// but we have seen one example where this is not the case for a MethodDef
|
||||
if (!Methods.ContainsKey(method)) {
|
||||
var fnPtr = declarationGenerator.GenerateMethodDeclaration(method);
|
||||
Methods.Add(method, fnPtr, new AppMethod(method, fnPtr) {Group = Group});
|
||||
}
|
||||
Methods[method].MethodInfoPtrAddress = address;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user