Skip to content

Commit

Permalink
Fix bug introduced in AbstractValidator.SetExecutedRuleSets
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremySkinner committed Oct 4, 2023
1 parent 4140e1f commit 7d91ccb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/FluentValidation/AbstractValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ private async ValueTask<ValidationResult> ValidateInternalAsync(ValidationContex
}

private void SetExecutedRuleSets(ValidationResult result, ValidationContext<T> context) {
if ((context.RootContextData.TryGetValue("_FV_RuleSetsExecuted", out var obj)) && (obj is HashSet<string> set))
{
result.RuleSetsExecuted = set.ToArray();
}

result.RuleSetsExecuted = RulesetValidatorSelector.DefaultRuleSetNameInArray;
if (context.RootContextData.TryGetValue("_FV_RuleSetsExecuted", out var obj) && obj is HashSet<string> set) {
result.RuleSetsExecuted = set.ToArray();
}
else {
result.RuleSetsExecuted = RulesetValidatorSelector.DefaultRuleSetNameInArray;
}
}

/// <summary>
Expand Down

0 comments on commit 7d91ccb

Please sign in to comment.