From a655e357995e2aac9137cfd61937ead803ab4170 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Wed, 10 Nov 2021 00:46:09 +0100 Subject: [PATCH] Fix ArgumentNullException in IntroduceUsingDeclarations: ignore unnamed variables for the purpose of conflict resolving. --- .../CSharp/Transforms/IntroduceUsingDeclarations.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceUsingDeclarations.cs b/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceUsingDeclarations.cs index 4a80ba55c..8ae658ae7 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceUsingDeclarations.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/IntroduceUsingDeclarations.cs @@ -163,7 +163,7 @@ namespace ICSharpCode.Decompiler.CSharp.Transforms { foreach (var v in function.Variables) { - if (v.Kind != IL.VariableKind.Parameter) + if (v.Kind != IL.VariableKind.Parameter && v.Name != null) resolver = resolver.AddVariable(new DefaultVariable(v.Type, v.Name)); } }