From aeeaa5c149fbb15a168c75a4f475f14968826fb9 Mon Sep 17 00:00:00 2001 From: "DEVB\\darius.kucinskas" Date: Thu, 16 May 2019 12:28:56 +0300 Subject: [PATCH] Fixed crash then type is null in type def matches. --- ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs index 7752d667e..0e7986d8f 100644 --- a/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs +++ b/ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs @@ -407,7 +407,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax bool TypeDefMatches(ITypeDefinition typeDef, IType type) { - if (type.Name != typeDef.Name || type.Namespace != typeDef.Namespace || type.TypeParameterCount != typeDef.TypeParameterCount) + if (type == null || type.Name != typeDef.Name || type.Namespace != typeDef.Namespace || type.TypeParameterCount != typeDef.TypeParameterCount) return false; bool defIsNested = typeDef.DeclaringTypeDefinition != null; bool typeIsNested = type.DeclaringType != null;