From 879f946f9589e6254567a6f777ac82547321201a Mon Sep 17 00:00:00 2001 From: Jeroen Frijters Date: Tue, 21 Feb 2017 15:23:32 +0100 Subject: [PATCH] Handle types without a name (invalid, but created by some obfuscator). --- src/Managed.Reflection/Reader/TypeDefImpl.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Managed.Reflection/Reader/TypeDefImpl.cs b/src/Managed.Reflection/Reader/TypeDefImpl.cs index d32cc68..7fdbf77 100644 --- a/src/Managed.Reflection/Reader/TypeDefImpl.cs +++ b/src/Managed.Reflection/Reader/TypeDefImpl.cs @@ -39,7 +39,8 @@ internal TypeDefImpl(ModuleReader module, int index) { this.module = module; this.index = index; - this.typeName = module.GetString(module.TypeDef.records[index].TypeName); + // empty typeName is not allowed, but obfuscators... + this.typeName = module.GetString(module.TypeDef.records[index].TypeName) ?? ""; this.typeNamespace = module.GetString(module.TypeDef.records[index].TypeNamespace); MarkKnownType(typeNamespace, typeName); }