diff options
author | Unknwon <u@gogs.io> | 2017-01-28 20:17:01 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-01-28 20:17:01 -0500 |
commit | 7b3b46c675b7b84f1aadb788078696b98cc0656c (patch) | |
tree | cfd84d2578772e16ae6f723b473a11f572788d37 /models/issue.go | |
parent | 5e01ecbc0528488427ee455578acbe7ff92efcfe (diff) |
Fix showing total number of PRs when user does not have any repositories (#4007)
Diffstat (limited to 'models/issue.go')
-rw-r--r-- | models/issue.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go index d17bc207..bf4d86e0 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) } |