Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 8519971

Browse files
authored
fix: addresses null pointer when contributors API returns no author (#489)
1 parent dd5bcb7 commit 8519971

File tree

2 files changed

+18
-14
lines changed

2 files changed

+18
-14
lines changed

.github/actions/sync-data/dist/index.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -23058,13 +23058,15 @@ function formatStats(project, stats) {
2305823058
);
2305923059

2306023060
const cachedContributors = Array.isArray(contributorStats)
23061-
? contributorStats.map(i => ({
23062-
id: i.author.id,
23063-
login: i.author.login,
23064-
avatarUrl: i.author.avatar_url,
23065-
htmlUrl: i.author.html_url,
23066-
contributions: i.total
23067-
}))
23061+
? contributorStats.map(i => {
23062+
return {
23063+
id: _.get(i, 'author.id'),
23064+
login: _.get(i, 'author.login'),
23065+
avatarUrl: _.get(i, 'author.avatar_url'),
23066+
htmlUrl: _.get(i, 'author.html_url'),
23067+
contributions: _.get(i, 'total')
23068+
};
23069+
})
2306823070
: [];
2306923071

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

.github/actions/sync-data/src/stats-generator/processor.js

+9-7
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ function formatStats(project, stats) {
5858
);
5959

6060
const cachedContributors = Array.isArray(contributorStats)
61-
? contributorStats.map(i => ({
62-
id: i.author.id,
63-
login: i.author.login,
64-
avatarUrl: i.author.avatar_url,
65-
htmlUrl: i.author.html_url,
66-
contributions: i.total
67-
}))
61+
? contributorStats.map(i => {
62+
return {
63+
id: _.get(i, 'author.id'),
64+
login: _.get(i, 'author.login'),
65+
avatarUrl: _.get(i, 'author.avatar_url'),
66+
htmlUrl: _.get(i, 'author.html_url'),
67+
contributions: _.get(i, 'total')
68+
};
69+
})
6870
: [];
6971

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

0 commit comments

Comments
 (0)