From 0cbac062b282e10b4c874cd901054005f6382da3 Mon Sep 17 00:00:00 2001 From: yystopf Date: Mon, 25 Aug 2025 15:23:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Aforge=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/api/v1/projects/explore_code/index.json.jbuilder | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/views/api/v1/projects/explore_code/index.json.jbuilder b/app/views/api/v1/projects/explore_code/index.json.jbuilder index 3dcae5060..3bf8c3e72 100644 --- a/app/views/api/v1/projects/explore_code/index.json.jbuilder +++ b/app/views/api/v1/projects/explore_code/index.json.jbuilder @@ -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"]