diff options
Diffstat (limited to 'models/repo')
-rw-r--r-- | models/repo/repo.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/models/repo/repo.go b/models/repo/repo.go index 43ac9fb62a..d0136e9c66 100644 --- a/models/repo/repo.go +++ b/models/repo/repo.go @@ -173,6 +173,13 @@ func (repo *Repository) SanitizedOriginalURL() string { // ColorFormat returns a colored string to represent this repo func (repo *Repository) ColorFormat(s fmt.State) { + if repo == nil { + log.ColorFprintf(s, "%d:%s/%s", + log.NewColoredIDValue(0), + "<nil>", + "<nil>") + return + } log.ColorFprintf(s, "%d:%s/%s", log.NewColoredIDValue(repo.ID), repo.OwnerName, |