Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Avoid a potential NRE if the nested type mapping is wrong (obfuscator)

  • Loading branch information...
commit aea2ceb687f989670d31db5232c77d089b0124ca 1 parent a8f871a
@jbevain jbevain authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 Mono.Cecil/AssemblyReader.cs
View
8 Mono.Cecil/AssemblyReader.cs
@@ -778,8 +778,12 @@ public Collection<TypeDefinition> ReadNestedTypes (TypeDefinition type)
var nested_types = new MemberDefinitionCollection<TypeDefinition> (type, mapping.Length);
- for (int i = 0; i < mapping.Length; i++)
- nested_types.Add (GetTypeDefinition (mapping [i]));
+ for (int i = 0; i < mapping.Length; i++) {
+ var nested_type = GetTypeDefinition (mapping [i]);
+
+ if (nested_type != null)
+ nested_types.Add (nested_type);
+ }
metadata.RemoveNestedTypeMapping (type);
Please sign in to comment.
Something went wrong with that request. Please try again.