Skip to content

Commit

Permalink
fix: addresses null pointer when contributors API returns no author (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeveland27 authored Jun 22, 2020
1 parent dd5bcb7 commit 8519971
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions .github/actions/sync-data/dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23058,13 +23058,15 @@ function formatStats(project, stats) {
);

const cachedContributors = Array.isArray(contributorStats)
? contributorStats.map(i => ({
id: i.author.id,
login: i.author.login,
avatarUrl: i.author.avatar_url,
htmlUrl: i.author.html_url,
contributions: i.total
}))
? contributorStats.map(i => {
return {
id: _.get(i, 'author.id'),
login: _.get(i, 'author.login'),
avatarUrl: _.get(i, 'author.avatar_url'),
htmlUrl: _.get(i, 'author.html_url'),
contributions: _.get(i, 'total')
};
})
: [];

const latestReleaseName = _.get(project, 'latestTag.nodes[0].name', false);
Expand Down
16 changes: 9 additions & 7 deletions .github/actions/sync-data/src/stats-generator/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,15 @@ function formatStats(project, stats) {
);

const cachedContributors = Array.isArray(contributorStats)
? contributorStats.map(i => ({
id: i.author.id,
login: i.author.login,
avatarUrl: i.author.avatar_url,
htmlUrl: i.author.html_url,
contributions: i.total
}))
? contributorStats.map(i => {
return {
id: _.get(i, 'author.id'),
login: _.get(i, 'author.login'),
avatarUrl: _.get(i, 'author.avatar_url'),
htmlUrl: _.get(i, 'author.html_url'),
contributions: _.get(i, 'total')
};
})
: [];

const latestReleaseName = _.get(project, 'latestTag.nodes[0].name', false);
Expand Down

0 comments on commit 8519971

Please sign in to comment.