fix: repo submodule is nil

This commit is contained in:
viletyy 2022-01-10 13:49:18 +08:00
parent c13048756b
commit f4becdc341
1 changed files with 3 additions and 1 deletions

View File

@ -184,7 +184,9 @@ func GetContents(repo *models.Repository, treePath, ref string, forList bool) (*
if err != nil {
return nil, err
}
contentsResponse.SubmoduleGitURL = &submodule.URL
if submodule != nil {
contentsResponse.SubmoduleGitURL = &submodule.URL
}
}
// Handle links
if entry.IsRegular() || entry.IsLink() {