mirror of
https://github.com/LukeFZ/Il2CppInspectorRedux.git
synced 2026-03-22 00:18:18 +05:00
add fallback if InlineArrayAttribute does not exist
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user