修复:forge项目不存在报错

This commit is contained in:
yystopf 2025-08-25 15:23:01 +08:00
parent 229ee55dbc
commit 0cbac062b2
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,11 @@ json.total_count @result[:total_count]
json.results @result[:data]["SearchResults"] do |repo|
project = Project.find_by(gpid: repo["RepoID"])
json.project do
json.partial! "api/v1/projects/detail", project: project
if project.present?
json.partial! "api/v1/projects/detail", project: project
else
json.nil!
end
end
json.filename repo["Filename"]
json.language repo["Language"]