fix submodule is nil panic (#23588)
#23587 submodule path is nil It is panic a nil error --------- Co-authored-by: delvh <[email protected]> Co-authored-by: KN4CK3R <[email protected]>
This commit is contained in:
co-authored by
delvh
KN4CK3R
parent
a8c30a45fa
commit
f83246edb2
@@ -214,7 +214,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 && submodule.URL != "" {
|
||||
contentsResponse.SubmoduleGitURL = &submodule.URL
|
||||
}
|
||||
}
|
||||
// Handle links
|
||||
if entry.IsRegular() || entry.IsLink() {
|
||||
|
||||
Reference in New Issue
Block a user