From 1883ab23828d4c19c8ee66cf93191f96d807db48 Mon Sep 17 00:00:00 2001 From: Leonhard Seidel Date: Mon, 17 Jul 2023 18:47:48 +0200 Subject: [PATCH] lessened issue in il2cppinterop where it would break for objects --- Il2CppInterop.Generator/Contexts/AssemblyRewriteContext.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Il2CppInterop.Generator/Contexts/AssemblyRewriteContext.cs b/Il2CppInterop.Generator/Contexts/AssemblyRewriteContext.cs index 29d84bf8..3ce6d55c 100644 --- a/Il2CppInterop.Generator/Contexts/AssemblyRewriteContext.cs +++ b/Il2CppInterop.Generator/Contexts/AssemblyRewriteContext.cs @@ -153,6 +153,8 @@ public TypeReference RewriteTypeRef(TypeReference? typeRef) { return Imports.Il2CppObjectBase; } + if(originalTypeDef == null) + return Imports.Il2CppObjectBase; var targetAssembly = GlobalContext.GetNewAssemblyForOriginal(originalTypeDef.Module.Assembly); var target = targetAssembly.GetContextForOriginalType(originalTypeDef).NewType;