From 86d43e9af68b95c62f1a7ecb96578816c2003350 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 30 May 2018 21:58:41 -0700 Subject: [PATCH] Close #75. Github no longer crashes on network failure --- github/github_repo.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/github/github_repo.go b/github/github_repo.go index df3644d2..7ced9123 100644 --- a/github/github_repo.go +++ b/github/github_repo.go @@ -37,6 +37,10 @@ func (repo *GithubRepo) Refresh() { /* -------------------- Counts -------------------- */ func (repo *GithubRepo) IssueCount() int { + if repo.RemoteRepo == nil { + return 0 + } + return *repo.RemoteRepo.OpenIssuesCount } @@ -45,6 +49,10 @@ func (repo *GithubRepo) PullRequestCount() int { } func (repo *GithubRepo) StarCount() int { + if repo.RemoteRepo == nil { + return 0 + } + return *repo.RemoteRepo.StargazersCount }