diff --git a/routers/search.go b/routers/search.go index 96b4b368a..1a774eec6 100644 --- a/routers/search.go +++ b/routers/search.go @@ -455,10 +455,14 @@ func makeIssueResult(sRes *elastic.SearchResult, Key string) *SearchRes { record["id"] = recordSource["id"] record["repo_id"] = recordSource["repo_id"] log.Info("recordSource[\"repo_id\"]=" + fmt.Sprint(recordSource["repo_id"])) - repo, errRepo := models.GetRepositoryByID(recordSource["repo_id"].(int64)) - if errRepo == nil { - record["repoUrl"] = repo.FullName() - record["avatar"] = repo.RelAvatarLink() + repoIdstr := recordSource["repo_id"].(string) + repoId, cerr := strconv.ParseInt(repoIdstr, 10, 64) + if cerr == nil { + repo, errRepo := models.GetRepositoryByID(repoId) + if errRepo == nil { + record["repoUrl"] = repo.FullName() + record["avatar"] = repo.RelAvatarLink() + } } record["name"] = recordSource["name"] desc := recordSource["content"].(string)