Skip to content

Commit db4a56e

Browse files
authored
fix(languages/analyzer): TypeError on null committer
Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
1 parent c3d0fb2 commit db4a56e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

source/plugins/languages/analyzer/recent.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class RecentAnalyzer extends Analyzer {
6767
...await Promise.allSettled(
6868
commits
6969
.flatMap(({payload}) => payload.commits)
70-
.filter(({committer}) => filters.text(committer?.email, this.authoring, {debug: false}))
70+
.filter(commit => filters.text(commit?.committer?.email, this.authoring, {debug: false}))
7171
.map(commit => commit.url)
7272
.map(async commit => (await this.rest.request(commit)).data),
7373
),

source/plugins/lines/index.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default async function({login, data, imports, rest, q, account}, {enabled
4444
return
4545
//Compute changes
4646
repos[handle] = {added: 0, deleted: 0, changed: 0}
47-
const contributors = stats.filter(({author}) => (context.mode === "repository") || (context.mode === "organization") ? true : author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase())
47+
const contributors = stats.filter(contributors => (context.mode === "repository") || (context.mode === "organization") ? true : contributors?.author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase())
4848
for (const contributor of contributors) {
4949
let added = 0, changed = 0, deleted = 0
5050
contributor.weeks.forEach(({a = 0, d = 0, c = 0, w}) => {
@@ -59,7 +59,7 @@ export default async function({login, data, imports, rest, q, account}, {enabled
5959
weeks[date].deleted += d
6060
weeks[date].changed += c
6161
})
62-
console.debug(`metrics/compute/${login}/plugins > lines > ${handle}: @${contributor.author.login} +${added} -${deleted} ~${changed}`)
62+
console.debug(`metrics/compute/${login}/plugins > lines > ${handle}: @${contributor?.author?.login} +${added} -${deleted} ~${changed}`)
6363
repos[handle].added += added
6464
repos[handle].deleted += deleted
6565
repos[handle].changed += changed

0 commit comments

Comments
 (0)