Return empty when searching issues with no repos (#26545)

This commit is contained in:
Jason Song
2023-08-18 01:42:17 +08:00
committed by GitHub
parent 47fddaadc8
commit b658f2c61b
3 changed files with 23 additions and 5 deletions

View File

@ -193,6 +193,10 @@ func SearchIssues(ctx *context.APIContext) {
ctx.Error(http.StatusInternalServerError, "SearchRepositoryIDs", err)
return
}
if len(repoIDs) == 0 {
// no repos found, don't let the indexer return all repos
repoIDs = []int64{0}
}
}
keyword := ctx.FormTrim("q")