From bcd25f4b8c97cc9dc021f9eb358ac24ab9bddb19 Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Sat, 28 Feb 2026 03:53:29 +0100 Subject: [PATCH] add fallback if InlineArrayAttribute does not exist --- Il2CppInspector.Common/Outputs/AssemblyShims.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Il2CppInspector.Common/Outputs/AssemblyShims.cs b/Il2CppInspector.Common/Outputs/AssemblyShims.cs index faeba4d..c9a291d 100644 --- a/Il2CppInspector.Common/Outputs/AssemblyShims.cs +++ b/Il2CppInspector.Common/Outputs/AssemblyShims.cs @@ -88,7 +88,7 @@ namespace Il2CppInspector.Outputs private TypeDef tokenAttribute; // Runtime attributes we need to add - private TypeInfo inlineArrayAttribute; + private TypeInfo? inlineArrayAttribute; // The namespace for our custom types private const string rootNamespace = "Il2CppInspector.DLL"; @@ -168,7 +168,7 @@ namespace Il2CppInspector.Outputs { if (model.Package.Version >= MetadataVersions.V1040) { - inlineArrayAttribute = model.TypesByFullName["System.Runtime.CompilerServices.InlineArrayAttribute"]; + inlineArrayAttribute = model.TypesByFullName.GetValueOrDefault("System.Runtime.CompilerServices.InlineArrayAttribute"); } } @@ -303,7 +303,7 @@ namespace Il2CppInspector.Outputs if (model.Package.Version >= MetadataVersions.V1040) { // L-TODO: Verify if we actually need to add the attribute ourselves; it might just be preserved - if (type.HasInlineArray) + if (type.HasInlineArray && inlineArrayAttribute != null) { var typeRef = GetTypeRef(module, inlineArrayAttribute); var ctorRef = new MemberRefUser(typeRef.Module, ".ctor",