Skip to content

Commit cc83135

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 6356016 commit cc83135

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/services/Elastic.Documentation.Services/Changelog/GitHubPrService.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,10 @@ private static (string? owner, string? repo, int? prNumber) ParsePrUrl(string pr
128128
}
129129

130130
// Handle just a PR number when owner/repo are provided
131-
if (int.TryParse(prUrl, out var prNumber))
131+
if (int.TryParse(prUrl, out var prNumber) &&
132+
!string.IsNullOrWhiteSpace(defaultOwner) && !string.IsNullOrWhiteSpace(defaultRepo))
132133
{
133-
if (!string.IsNullOrWhiteSpace(defaultOwner) && !string.IsNullOrWhiteSpace(defaultRepo))
134-
{
135-
return (defaultOwner, defaultRepo, prNumber);
136-
}
134+
return (defaultOwner, defaultRepo, prNumber);
137135
}
138136

139137
return (null, null, null);

0 commit comments

Comments
 (0)