Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit aea2ceb687f989670d31db5232c77d089b0124ca 1 parent a8f871a
Jb Evain jbevain authored

Showing 1 changed file with 6 additions and 2 deletions. Show diff stats Hide diff stats

  1. +6 2 Mono.Cecil/AssemblyReader.cs
8 Mono.Cecil/AssemblyReader.cs
@@ -778,8 +778,12 @@ public Collection<TypeDefinition> ReadNestedTypes (TypeDefinition type)
778 778
779 779 var nested_types = new MemberDefinitionCollection<TypeDefinition> (type, mapping.Length);
780 780
781   - for (int i = 0; i < mapping.Length; i++)
782   - nested_types.Add (GetTypeDefinition (mapping [i]));
  781 + for (int i = 0; i < mapping.Length; i++) {
  782 + var nested_type = GetTypeDefinition (mapping [i]);
  783 +
  784 + if (nested_type != null)
  785 + nested_types.Add (nested_type);
  786 + }
783 787
784 788 metadata.RemoveNestedTypeMapping (type);
785 789

0 comments on commit aea2ceb

Please sign in to comment.
Something went wrong with that request. Please try again.