Skip to content

Commit

Permalink
Fix NRE in Assembly ctor on < v24.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeFZ committed Nov 9, 2024
1 parent 3982e5f commit bcbf4f4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Il2CppInspector.Common/Reflection/Assembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit bcbf4f4

Please sign in to comment.