Merge pull request #613 from aguang-xyz/fix/npe-when-target-not-specified

Fix IndexOutOfRangeException in build command parsing logic
This commit is contained in:
Robert Muehsig
2022-02-21 22:55:01 +01:00
committed by GitHub

View File

@@ -62,7 +62,7 @@ namespace ElectronNET.CLI.Commands
if (parser.Arguments.ContainsKey(_paramVersion))
version = parser.Arguments[_paramVersion][0];
if (!parser.Arguments.ContainsKey(_paramTarget))
if (!parser.Arguments.ContainsKey(_paramTarget) || parser.Arguments[_paramTarget].Length == 0)
{
Console.WriteLine($"Error: missing '{_paramTarget}' argument.");
Console.WriteLine(COMMAND_ARGUMENTS);