Fix missing author

This commit is contained in:
Rodrigo Pombo 2019-02-05 12:54:08 -03:00
parent d2131db616
commit ac307d2074

View File

@ -26,8 +26,10 @@ export async function getHistory(repo, sha, path, top = 10) {
sha: commit.sha,
date: new Date(commit.commit.author.date),
author: {
login: commit.author.login,
avatar: commit.author.avatar_url
login: commit.author ? commit.author.login : commit.commit.author.name,
avatar: commit.author
? commit.author.avatar_url
: "https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"
},
commitUrl: commit.html_url,
message: commit.commit.message