diff --git a/models/repo.go b/models/repo.go index f838de7eaa18..95063134a8ff 100644 --- a/models/repo.go +++ b/models/repo.go @@ -957,10 +957,13 @@ func countRepositories(showPrivate bool) int64 { sess := x.NewSession() if !showPrivate { - sess.Where("is_private=", false) + sess.Where("is_private=?", false) } - count, _ := sess.Count(new(Repository)) + count, err := sess.Count(new(Repository)) + if err != nil { + log.Error(4, "countRepositories: %v", err) + } return count }