Fix error logged when repos qs is empty (#9591)

* Fix error logged when repos qs is empty

* Update routers/user/home.go

Co-Authored-By: Lauris BH <lauris@nix.lv>

Co-authored-by: techknowlogick <matti@mdranta.net>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
guillep2k 2020-01-03 18:39:12 -03:00 committed by Lauris BH
parent 4a768e1c3e
commit bedd7b2833

View file

@ -389,6 +389,7 @@ func Issues(ctx *context.Context) {
reposQuery := ctx.Query("repos") reposQuery := ctx.Query("repos")
var repoIDs []int64 var repoIDs []int64
if len(reposQuery) != 0 {
if issueReposQueryPattern.MatchString(reposQuery) { if issueReposQueryPattern.MatchString(reposQuery) {
// remove "[" and "]" from string // remove "[" and "]" from string
reposQuery = reposQuery[1 : len(reposQuery)-1] reposQuery = reposQuery[1 : len(reposQuery)-1]
@ -405,6 +406,7 @@ func Issues(ctx *context.Context) {
} else { } else {
log.Error("issueReposQueryPattern not match with query") log.Error("issueReposQueryPattern not match with query")
} }
}
isShowClosed := ctx.Query("state") == "closed" isShowClosed := ctx.Query("state") == "closed"