From caaba6478926192b4cce5ab30d36b8ae7ce79c75 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Thu, 3 Jun 2021 17:06:38 -0700 Subject: [PATCH] Defend against null value in BuildErrorEventArgs --- src/OmniSharp.MSBuild/Logging/MSBuildDiagnostic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OmniSharp.MSBuild/Logging/MSBuildDiagnostic.cs b/src/OmniSharp.MSBuild/Logging/MSBuildDiagnostic.cs index 11f48f0d9a..fdb6377dc9 100644 --- a/src/OmniSharp.MSBuild/Logging/MSBuildDiagnostic.cs +++ b/src/OmniSharp.MSBuild/Logging/MSBuildDiagnostic.cs @@ -40,7 +40,7 @@ public static MSBuildDiagnostic CreateFrom(Microsoft.Build.Framework.BuildErrorE // https://github.com/dotnet/msbuild/blob/v16.8.3/src/Tasks/Resources/Strings.resx#L2155-L2158 // for MSB3644, we should print a different message on Unix because the default one is Windows-specific - if (args.Code.Equals("MSB3644", StringComparison.OrdinalIgnoreCase)) + if (args.Code?.Equals("MSB3644", StringComparison.OrdinalIgnoreCase) == true) { // https://github.com/dotnet/msbuild/issues/5820 // older versions of MSBuild incorrectly treat 'net5.0'/'net6.0' moniker as ".NETFramework,Version=v5.0/6.0"