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 AmirandAlexandr authored and GitHub committed 2025-09-24 22:55:49 +03:00
1 parent be0dba8986
commit 4f17194684
2 files changed
+45 -1

No files matched your search

+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;