新增:submodule为nil判断

This commit is contained in:
yystopf 2023-03-17 10:27:46 +08:00
parent 4f2b053d16
commit bc2c836cf1
1 changed files with 3 additions and 1 deletions

View File

@ -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() {