From bb372a1299e1680cfa88cc259ceb3a3f6ca4633c Mon Sep 17 00:00:00 2001 From: mikelle-rogers <45022607+mikelle-rogers@users.noreply.github.com> Date: Mon, 4 Apr 2022 17:58:14 -0600 Subject: [PATCH] dotnet tools ps handling of no supported managed processes (#2979) * Add the case where no supported managed processes were found --- src/Tools/Common/Commands/ProcessStatus.cs | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.34.1