Skip to content

Commit

Permalink
Fix NRE when parsing non existing nested types
Browse files Browse the repository at this point in the history
  • Loading branch information
jbevain committed Jul 22, 2015
1 parent 9ba8f02 commit 3723f62
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Mono.Cecil/TypeParser.cs
Expand Up @@ -390,8 +390,13 @@ static bool TryGetDefinition (ModuleDefinition module, Type type_info, out TypeR

var nested_names = type_info.nested_names;
if (!nested_names.IsNullOrEmpty ()) {
for (int i = 0; i < nested_names.Length; i++)
typedef = typedef.GetNestedType (nested_names [i]);
for (int i = 0; i < nested_names.Length; i++) {
var nested_type = typedef.GetNestedType (nested_names [i]);
if (nested_type == null)
return false;

typedef = nested_type;
}
}

type = typedef;
Expand Down

0 comments on commit 3723f62

Please sign in to comment.