mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Check that switchKey isn't empty
This commit is contained in:
1 parent
e3fd809d42
commit
75777b42ee
1 file changed
+1
-1
@@ -354,7 +354,7 @@ namespace Microsoft.PowerShell
|
||||
switchKey = switchKey.Substring(1);
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user