diff --git a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs index efac4c6614..a5744648cd 100644 --- a/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs +++ b/src/vstest.console/Processors/Utilities/ArgumentProcessorUtilities.cs @@ -18,12 +18,19 @@ internal class ArgumentProcessorUtilities /// Argument separator. /// Exception Message. /// Argument list. - public static string[] GetArgumentList(string? rawArgument, char[] argumentSeparator, string exceptionMessage) + public static string[] GetArgumentList(string rawArgument, char[] argumentSeparator, string exceptionMessage) { - var argumentList = rawArgument?.Split(argumentSeparator, StringSplitOptions.RemoveEmptyEntries); + var argumentList = rawArgument.Split(argumentSeparator, StringSplitOptions.RemoveEmptyEntries); // Throw error in case of invalid argument. - return argumentList == null || argumentList.Length <= 0 ? throw new CommandLineException(exceptionMessage) : argumentList; + if (argumentList.Length <= 0) + { + throw new CommandLineException(exceptionMessage); + } + else + { + return argumentList; + } } ///