fix: display correct data when user don't have any pull requests (#4452)

* Fix: When user doesn't have any PR, it's Merged PRs Percentage is NAN (fixes #4449)

* review

---------

Co-authored-by: Alexandr <qwerty541zxc@gmail.com>
This commit is contained in:
Mohd Amir
2025-09-24 22:55:49 +03:00
committed by GitHub
co-authored by Alexandr
parent be0dba8986
commit 4f17194684
2 changed files with 45 additions and 1 deletions
+2 -1
View File
@@ -297,7 +297,8 @@ const fetchStats = async (
if (include_merged_pull_requests) {
stats.totalPRsMerged = user.mergedPullRequests.totalCount;
stats.mergedPRsPercentage =
(user.mergedPullRequests.totalCount / user.pullRequests.totalCount) * 100;
(user.mergedPullRequests.totalCount / user.pullRequests.totalCount) *
100 || 0;
}
stats.totalReviews = user.reviews.totalPullRequestReviewContributions;
stats.totalIssues = user.openIssues.totalCount + user.closedIssues.totalCount;