Skip to content

Commit 0b1054d

Browse files
Potential fix for pull request finding 'Nested 'if' statements can be combined'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 7b2eeb4 commit 0b1054d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/services/Elastic.Documentation.Services/ReleaseNotesService.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,10 @@ Cancel ctx
6767
}
6868

6969
// Validate subtype if provided
70-
if (!string.IsNullOrWhiteSpace(input.Subtype))
70+
if (!string.IsNullOrWhiteSpace(input.Subtype) && !config.AvailableSubtypes.Contains(input.Subtype))
7171
{
72-
if (!config.AvailableSubtypes.Contains(input.Subtype))
73-
{
74-
collector.EmitError(string.Empty, $"Subtype '{input.Subtype}' is not in the list of available subtypes. Available subtypes: {string.Join(", ", config.AvailableSubtypes)}");
75-
return false;
76-
}
72+
collector.EmitError(string.Empty, $"Subtype '{input.Subtype}' is not in the list of available subtypes. Available subtypes: {string.Join(", ", config.AvailableSubtypes)}");
73+
return false;
7774
}
7875

7976
// Validate areas if configuration provides available areas

0 commit comments

Comments
 (0)