diff --git a/source/plugins/languages/analyzer/recent.mjs b/source/plugins/languages/analyzer/recent.mjs index 927c91a7189..3ab2c4c4ea8 100644 --- a/source/plugins/languages/analyzer/recent.mjs +++ b/source/plugins/languages/analyzer/recent.mjs @@ -67,7 +67,7 @@ export class RecentAnalyzer extends Analyzer { ...await Promise.allSettled( commits .flatMap(({payload}) => payload.commits) - .filter(({committer}) => filters.text(committer?.email, this.authoring, {debug: false})) + .filter(commit => commit && filters.text(commit.committer?.email, this.authoring, {debug: false})) .map(commit => commit.url) .map(async commit => (await this.rest.request(commit)).data), ), diff --git a/source/plugins/lines/index.mjs b/source/plugins/lines/index.mjs index 33000a75fcb..4144cede6bd 100644 --- a/source/plugins/lines/index.mjs +++ b/source/plugins/lines/index.mjs @@ -44,7 +44,7 @@ export default async function({login, data, imports, rest, q, account}, {enabled return //Compute changes repos[handle] = {added: 0, deleted: 0, changed: 0} - const contributors = stats.filter(({author}) => (context.mode === "repository") || (context.mode === "organization") ? true : author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase()) + const contributors = stats.filter(contributors => contributors && ((context.mode === "repository") || (context.mode === "organization") ? true : contributors.author?.login?.toLocaleLowerCase() === login.toLocaleLowerCase())) for (const contributor of contributors) { let added = 0, changed = 0, deleted = 0 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 weeks[date].deleted += d weeks[date].changed += c }) - console.debug(`metrics/compute/${login}/plugins > lines > ${handle}: @${contributor.author.login} +${added} -${deleted} ~${changed}`) + console.debug(`metrics/compute/${login}/plugins > lines > ${handle}: @${contributor.author?.login} +${added} -${deleted} ~${changed}`) repos[handle].added += added repos[handle].deleted += deleted repos[handle].changed += changed