From df27dc96860e37bb17f635dc887b6e8f634c6709 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald <daniel@danielgrunwald.de> Date: Fri, 15 Sep 2017 19:46:44 +0200 Subject: [PATCH] Fix NullReferenceException in SplitVariables.AddressUsedOnlyForReading --- ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs b/ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs index 60e0bec07..da89fb969 100644 --- a/ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs +++ b/ICSharpCode.Decompiler/IL/Transforms/SplitVariables.cs @@ -80,7 +80,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms // but we need to split awaiter variables to make async/await pretty. return true; case Call call: - if (call.Method.DeclaringTypeDefinition.KnownTypeCode == TypeSystem.KnownTypeCode.NullableOfT) { + if (call.Method.DeclaringTypeDefinition?.KnownTypeCode == TypeSystem.KnownTypeCode.NullableOfT) { switch (call.Method.Name) { case "get_HasValue": case "get_Value":