Check that switchKey isn't empty
This commit is contained in:
parent
e3fd809d42
commit
75777b42ee
1 changed files with 1 additions and 1 deletions
|
@ -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