Skip to content

Commit

Permalink
Merge pull request anuraghazra#37 from anuraghazra/fix-name-null
Browse files Browse the repository at this point in the history
fix: fallback to login if name not found
  • Loading branch information
anuraghazra authored Jul 13, 2020
2 parents fdeaad3 + d56ef0d commit 8e8d7dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fetchStats.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ async function fetchStats(username) {
query userInfo($login: String!) {
user(login: $login) {
name
login
repositoriesContributedTo(first: 100, contributionTypes: [COMMIT, ISSUE, PULL_REQUEST, REPOSITORY]) {
totalCount
}
Expand Down Expand Up @@ -50,7 +51,7 @@ async function fetchStats(username) {

const user = res.data.data.user;

stats.name = user.name;
stats.name = user.name || user.login;
stats.totalIssues = user.issues.totalCount;
stats.totalCommits = user.contributionsCollection.totalCommitContributions;
stats.totalPRs = user.pullRequests.totalCount;
Expand Down

0 comments on commit 8e8d7dd

Please sign in to comment.