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-10-25 12:39:44 +02:00
committed by martin-mfg
co-authored by Alexandr
parent 7fbc3d0bfb
commit f2efd6052b
2 changed files with 45 additions and 1 deletions
+2 -1
View File
@@ -408,7 +408,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;