Check that switchKey isn't empty
This commit is contained in:
parent
e3fd809d42
commit
75777b42ee
|
@ -354,7 +354,7 @@ namespace Microsoft.PowerShell
|
||||||
switchKey = switchKey.Substring(1);
|
switchKey = switchKey.Substring(1);
|
||||||
|
|
||||||
// chop off the second dash so we're agnostic wrt specifying - or --
|
// chop off the second dash so we're agnostic wrt specifying - or --
|
||||||
if (SpecialCharacters.IsDash(switchKey[0]))
|
if (!String.IsNullOrEmpty(switchKey) && SpecialCharacters.IsDash(switchKey[0]))
|
||||||
{
|
{
|
||||||
switchKey = switchKey.Substring(1);
|
switchKey = switchKey.Substring(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue