Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/Microsoft.PowerShell.ConsoleHost/host/msh/ConsoleHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ internal static int Start(

try
{
string[] tempArgs = new string[args.GetLength(0)];
args.CopyTo(tempArgs, 0);

// We might be able to ignore console host creation error if we are running in
// server mode, which does not require a console.
HostException hostException = null;
Expand All @@ -163,16 +160,11 @@ internal static int Start(
hostException = e;
}

if (args == null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably leave the null check in the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is c# convention that args is never null?

{
args = new string[0];
}

s_cpp = new CommandLineParameterParser(
(s_theConsoleHost != null) ? s_theConsoleHost.UI : (new NullHostUserInterface()),
bannerText, helpText);

s_cpp.Parse(tempArgs);
s_cpp.Parse(args);

#if UNIX
// On Unix, logging has to be deferred until after command-line parsing
Expand Down