forked from mirrored/github-readme-stats
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user