Skip to content
This repository has been archived by the owner on Nov 16, 2022. It is now read-only.

System.IndexOutOfRangeException from Microsoft.DotNet.Cli.CommandLine.StringExtensions.HasPrefix #105

Open
tmat opened this issue May 3, 2018 · 1 comment

Comments

@tmat
Copy link
Member

tmat commented May 3, 2018

>dotnet.exe msbuild ""
System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.String.get_Chars(Int32 index)
   at Microsoft.DotNet.Cli.CommandLine.StringExtensions.HasPrefix(String arg)
   at Microsoft.DotNet.Cli.CommandLine.StringExtensions.<Lex>d__7.MoveNext()
   at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
   at System.Collections.Generic.Queue`1..ctor(IEnumerable`1 collection)
   at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(IReadOnlyCollection`1 rawArgs, Boolean isProgressive)
   at Microsoft.DotNet.Cli.CommandLine.Parser.Parse(String[] args)
   at Microsoft.DotNet.Cli.ParserExtensions.ParseFrom(Parser parser, String context, String[] args)
   at Microsoft.DotNet.Cli.Program.ProcessArgs(String[] args, ITelemetry telemetryClient)
   at Microsoft.DotNet.Cli.Program.Main(String[] args)
@peterhuene
Copy link

The check on

if (string.IsNullOrWhiteSpace(token))
should simply be for null, not for null or whitespace.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants