Visitar URL original
fix · PowerShell/PowerShell@aaf9270 · GitHub
Skip to content

Commit aaf9270

Browse files
author
AkshayDhola
committed
fix
1 parent e4292ea commit aaf9270

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/System.Management.Automation/engine/runtime/Operations

‎src/System.Management.Automation/engine/runtime/Operations/MiscOps.cs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,8 @@ internal static bool ConditionSatisfiedRegex(bool caseSensitive,
24952495

24962496
if (groups.Count > 0)
24972497
{
2498+
Diagnostics.Assert(regex != null, "Logic above ensures regex is not null.");
2499+
24982500
Hashtable h = new Hashtable(StringComparer.CurrentCultureIgnoreCase);
24992501

25002502
foreach (string groupName in regex.GetGroupNames())
@@ -2503,6 +2505,7 @@ internal static bool ConditionSatisfiedRegex(bool caseSensitive,
25032505
if (g.Success)
25042506
{
25052507
int keyInt;
2508+
25062509
if (Int32.TryParse(groupName, out keyInt))
25072510
h.Add(keyInt, g.ToString());
25082511
else

0 commit comments

Comments
 (0)