From bc2c836cf10851f0f24fd718fd768fc3045837c5 Mon Sep 17 00:00:00 2001 From: yystopf Date: Fri, 17 Mar 2023 10:27:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=EF=BC=9Asubmodule=E4=B8=BAni?= =?UTF-8?q?l=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/repository/files/content.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/repository/files/content.go b/services/repository/files/content.go index cee5cb0..d1d043e 100644 --- a/services/repository/files/content.go +++ b/services/repository/files/content.go @@ -178,7 +178,9 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref if err != nil { return nil, err } - contentsResponse.SubmoduleGitURL = &submodule.URL + if submodule != nil { + contentsResponse.SubmoduleGitURL = &submodule.URL + } } // Handle links if entry.IsRegular() || entry.IsLink() {