From ccdb746a4c308f907567d01b66d102d1aea7c013 Mon Sep 17 00:00:00 2001 From: Jason Zhai Date: Tue, 10 Dec 2024 19:06:43 -0800 Subject: [PATCH] Unlock build failed due to enabling nullable --- src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs index 37906b1dcc1b..9a0683694ba6 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Command.cs @@ -41,7 +41,7 @@ public CommandResult Execute(Action? processStarted) _process.EnableRaisingEvents = true; - Stopwatch sw = null; + Stopwatch? sw = null; if (CommandLoggingContext.IsVerbose) { sw = Stopwatch.StartNew(); @@ -78,7 +78,7 @@ public CommandResult Execute(Action? processStarted) LocalizableStrings.ProcessExitedWithCode, FormatProcessInfo(_process.StartInfo), exitCode, - sw.ElapsedMilliseconds); + sw?.ElapsedMilliseconds); if (exitCode == 0) { Reporter.Verbose.WriteLine(message.Green());