1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-21 17:58:35 +00:00

Fix submodule nil check (#35096)

Fix  #35095
This commit is contained in:
wxiaoguang
2025-07-16 20:07:38 +08:00
committed by GitHub
parent e1e4815a1c
commit fc4cb07beb
3 changed files with 14 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ type CommitInfo struct {
func getCommitInfoSubmoduleFile(repoLink string, entry *TreeEntry, commit *Commit, treePathDir string) (*CommitSubmoduleFile, error) {
fullPath := path.Join(treePathDir, entry.Name())
submodule, err := commit.GetSubModule(fullPath)
if err != nil {
if submodule == nil || err != nil {
return nil, err
}
return NewCommitSubmoduleFile(repoLink, fullPath, submodule.URL, entry.ID.String()), nil