From 7b3b46c675b7b84f1aadb788078696b98cc0656c Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 28 Jan 2017 20:17:01 -0500 Subject: [PATCH] Fix showing total number of PRs when user does not have any repositories (#4007) --- gogs.go | 2 +- models/issue.go | 4 ++-- templates/.VERSION | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gogs.go b/gogs.go index c429cebc1..8a9bc5235 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.124.0128" +const APP_VER = "0.9.125.0128" func init() { setting.AppVer = APP_VER diff --git a/models/issue.go b/models/issue.go index d17bc2073..bf4d86e0c 100644 --- a/models/issue.go +++ b/models/issue.go @@ -1169,13 +1169,13 @@ func GetIssueStats(opts *IssueStatsOptions) *IssueStats { // GetUserIssueStats returns issue statistic information for dashboard by given conditions. func GetUserIssueStats(repoID, userID int64, repoIDs []int64, filterMode FilterMode, isPull bool) *IssueStats { stats := &IssueStats{} - hasAnyRepo := repoID > 0 || repoIDs != nil + hasAnyRepo := repoID > 0 || len(repoIDs) > 0 countSession := func(isClosed, isPull bool, repoID int64, repoIDs []int64) *xorm.Session { sess := x.Where("issue.is_closed = ?", isClosed).And("issue.is_pull = ?", isPull) if repoID > 0 { sess.And("repo_id = ?", repoID) - } else if repoIDs != nil { + } else if len(repoIDs) > 0 { sess.In("repo_id", repoIDs) } diff --git a/templates/.VERSION b/templates/.VERSION index 6cab66f67..e3ea0be9d 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.124.0128 \ No newline at end of file +0.9.125.0128 \ No newline at end of file