handle phantom fork cases (#53)

closes #49
This commit is contained in:
Samar Dhwoj Acharya 2021-01-17 23:56:26 -06:00 committed by GitHub
parent 4428b1dd0f
commit 49f113e40c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -47,7 +47,7 @@ function updateDT(data) {
const forks = [];
for (let fork of data) {
fork.repoLink = `<a href="https://github.com/${fork.full_name}">Link</a>`;
fork.ownerName = fork.owner.login;
fork.ownerName = fork.owner ? fork.owner.login : '<strike><em>Unknown</em></strike>';
forks.push(fork);
}
const dataSet = forks.map(fork =>
@ -114,7 +114,6 @@ function fetchAndShow(repo) {
return response.json();
})
.then(data => {
console.log(data);
updateDT(data);
})
.catch(error => {