Handle null authors in lines plugin (#173)

This commit is contained in:
lowlighter
2021-03-04 21:15:00 +01:00
parent 9e9b066be9
commit 3e6c713dc4

View File

@@ -31,7 +31,7 @@
if (!Array.isArray(repository))
return
//Extract author
const [contributor] = repository.filter(({author}) => context.mode === "repository" ? true : author.login === login)
const [contributor] = repository.filter(({author}) => context.mode === "repository" ? true : author?.login === login)
//Compute editions
if (contributor)
contributor.weeks.forEach(({a, d}) => (lines.added += a, lines.deleted += d))