From: mikelle-rogers <45022607+mikelle-rogers@users.noreply.github.com> Date: Mon, 4 Apr 2022 23:58:14 +0000 (-0600) Subject: dotnet tools ps handling of no supported managed processes (#2979) X-Git-Tag: accepted/tizen/unified/20221103.165810~28^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb372a1299e1680cfa88cc259ceb3a3f6ca4633c;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git dotnet tools ps handling of no supported managed processes (#2979) * Add the case where no supported managed processes were found --- diff --git a/src/Tools/Common/Commands/ProcessStatus.cs b/src/Tools/Common/Commands/ProcessStatus.cs index c9e7bade6..9a83d7c71 100644 --- a/src/Tools/Common/Commands/ProcessStatus.cs +++ b/src/Tools/Common/Commands/ProcessStatus.cs @@ -97,6 +97,11 @@ namespace Microsoft.Internal.Common.Commands void FormatTableRows(List rows, StringBuilder tableText) { + if (rows.Count == 0) + { + tableText.Append("No supported .NET processes were found"); + return; + } var processIDs = rows.Select(i => i.ProcessId.ToString().Length); var processNames = rows.Select(i => i.ProcessName.Length); var fileNames = rows.Select(i => i.FileName.Length);