diff --git a/Il2CppDumper/Outputs/StructGenerator.cs b/Il2CppDumper/Outputs/StructGenerator.cs index a2850bb2..5cc4e9b0 100644 --- a/Il2CppDumper/Outputs/StructGenerator.cs +++ b/Il2CppDumper/Outputs/StructGenerator.cs @@ -475,10 +475,13 @@ private void AddMetadataUsageMethodRef(ScriptJson json, uint index, ulong addres scriptMetadataMethod.Address = il2Cpp.GetRVA(address); (var methodSpecTypeName, var methodSpecMethodName) = executor.GetMethodSpecName(methodSpec, true); scriptMetadataMethod.Name = "Method$" + methodSpecTypeName + "." + methodSpecMethodName + "()"; - var genericMethodPointer = il2Cpp.methodSpecGenericMethodPointers[methodSpec]; - if (genericMethodPointer > 0) + if (il2Cpp.methodSpecGenericMethodPointers.ContainsKey(methodSpec)) { - scriptMetadataMethod.MethodAddress = il2Cpp.GetRVA(genericMethodPointer); + var genericMethodPointer = il2Cpp.methodSpecGenericMethodPointers[methodSpec]; + if (genericMethodPointer > 0) + { + scriptMetadataMethod.MethodAddress = il2Cpp.GetRVA(genericMethodPointer); + } } }