From bcbf4f47e2df80f73ddf593e9b199c5a372b8c62 Mon Sep 17 00:00:00 2001 From: LukeFZ <17146677+LukeFZ@users.noreply.github.com> Date: Sat, 9 Nov 2024 15:44:11 +0100 Subject: [PATCH] Fix NRE in Assembly ctor on < v24.2 --- Il2CppInspector.Common/Reflection/Assembly.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Il2CppInspector.Common/Reflection/Assembly.cs b/Il2CppInspector.Common/Reflection/Assembly.cs index 30b0b101..260a5801 100644 --- a/Il2CppInspector.Common/Reflection/Assembly.cs +++ b/Il2CppInspector.Common/Reflection/Assembly.cs @@ -71,8 +71,9 @@ public Assembly(TypeModel model, int imageIndex) { // TODO: Generate EntryPoint method from entryPointIndex } - // Find corresponding module (we'll need this for method pointers) - ModuleDefinition = Model.Package.Modules[ShortName]; + // Find corresponding module (we'll need this for method pointers on V24.2+) + if (Model.Package.Modules != null) + ModuleDefinition = Model.Package.Modules[ShortName]; // Generate types in DefinedTypes from typeStart to typeStart+typeCount-1 for (var t = ImageDefinition.TypeStart; t < ImageDefinition.TypeStart + ImageDefinition.TypeCount; t++) {