aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-09-01 06:31:47 -0400
committerUnknwon <u@gogs.io>2015-09-01 06:31:47 -0400
commit17c2d1fc7c236d6a0e7809c4cde0b9f6a029dfb0 (patch)
treebdb5f989da0e64434b449ad823052c3c8191f2aa /models/issue.go
parent6c7a93a3acdac90f9af1efbc67961b84f46caa56 (diff)
downloadgitea-17c2d1fc7c236d6a0e7809c4cde0b9f6a029dfb0.tar.gz
gitea-17c2d1fc7c236d6a0e7809c4cde0b9f6a029dfb0.zip
fix dashboard 500 when no issues at all
- update locales - update README
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/models/issue.go b/models/issue.go
index 5ae7f32bcd..28f37bf82c 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -410,6 +410,10 @@ func Issues(uid, assigneeID, repoID, posterID, milestoneID int64, repoIDs []int6
if repoID > 0 {
sess.Where("issue.repo_id=?", repoID).And("issue.is_closed=?", isClosed)
} else if repoIDs != nil {
+ // In case repository IDs are provided but actually no repository has issue.
+ if len(repoIDs) == 0 {
+ return make([]*Issue, 0), nil
+ }
sess.Where("issue.repo_id IN ("+strings.Join(base.Int64sToStrings(repoIDs), ",")+")").And("issue.is_closed=?", isClosed)
} else {
sess.Where("issue.is_closed=?", isClosed)