Skip to content

Commit

Permalink
Fix null ParameterDefinition when copying (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
ds5678 authored Sep 29, 2024
1 parent d422f5b commit d2cd4f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Il2CppInterop.Generator/Passes/Pass19CopyMethodParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static void DoPass(RewriteGlobalContext context)
var newParameter = newMethod.AddParameter(
assemblyContext.RewriteTypeRef(originalMethodParameter.ParameterType),
newName,
originalMethodParameter.Definition!.Attributes & ~ParameterAttributes.HasFieldMarshal);
originalMethodParameter.GetOrCreateDefinition().Attributes & ~ParameterAttributes.HasFieldMarshal);

if (originalMethodParameter.IsParamsArray())
{
Expand All @@ -35,7 +35,7 @@ public static void DoPass(RewriteGlobalContext context)
}
else
{
newParameter.Definition!.Constant = originalMethodParameter.Definition.Constant;
newParameter.Definition!.Constant = originalMethodParameter.Definition!.Constant;
}
}

Expand Down

0 comments on commit d2cd4f7

Please sign in to comment.