From 96e15a7521925e3762af4ae513e7fb1e5ec0589f Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Sun, 10 Jan 2021 03:32:30 +0100 Subject: [PATCH] DLL: Don't try to add property tokens if there is no definition --- Il2CppInspector.Common/Outputs/AssemblyShims.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/Outputs/AssemblyShims.cs b/Il2CppInspector.Common/Outputs/AssemblyShims.cs index 32083eb..a6d02e5 100644 --- a/Il2CppInspector.Common/Outputs/AssemblyShims.cs +++ b/Il2CppInspector.Common/Outputs/AssemblyShims.cs @@ -253,7 +253,9 @@ namespace Il2CppInspector.Outputs mProp.SetMethod = AddMethod(module, mType, prop.SetMethod); // Add token attribute - mProp.AddAttribute(module, tokenAttribute, ("Token", $"0x{prop.Definition.token:X8}")); + // Generic properties and constructed properties (from disperate get/set methods) have no definition + if (prop.Definition != null) + mProp.AddAttribute(module, tokenAttribute, ("Token", $"0x{prop.Definition.token:X8}")); // Add custom attribute attributes foreach (var ca in prop.CustomAttributes)