Skip to content

Commit

Permalink
fix(github): handle non-existing commit user (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
kettanaito authored Mar 22, 2023
1 parent 4de9cb2 commit 3fee8ce
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils/github/getCommitAuthors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ export async function getCommitAuthors(
// Add each commit author in the pull request.
for (const commit of data.repository.pullRequest.commits.nodes) {
for (const author of commit.commit.authors.nodes) {
addAuthor(author.user.login)
/**
* @note In some situations, GitHub will return "user: null"
* for the commit user. Nobody to add to the authors then.
*/
if (author.user != null) {
addAuthor(author.user.login)
}
}
}

Expand Down

0 comments on commit 3fee8ce

Please sign in to comment.