From 46bf6f2413a2a16e4ce282f87e582e2e4863f1be Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Mon, 10 Feb 2020 08:44:43 +0100 Subject: [PATCH] IL2CPP: Don't crash on assemblies with zero attributes (issue #19) --- Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs index 024063c..6708cd3 100644 --- a/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs +++ b/Il2CppInspector.Common/IL2CPP/Il2CppInspector.cs @@ -226,7 +226,8 @@ namespace Il2CppInspector var token = AttributeTypeRanges[index].token; attsByToken.Add(token, index); } - AttributeIndicesByToken.Add(image.customAttributeStart, attsByToken); + if (image.customAttributeCount > 0) + AttributeIndicesByToken.Add(image.customAttributeStart, attsByToken); } }