Skip to content

Commit 1e11f59

Browse files
viletyydelvhKN4CK3R
authored andcommitted
fix submodule is nil panic (go-gitea#23588)
go-gitea#23587 submodule path is nil It is panic a nil error --------- Co-authored-by: delvh <[email protected]> Co-authored-by: KN4CK3R <[email protected]>
1 parent a3b9171 commit 1e11f59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/repository/files/content.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ func GetContents(ctx context.Context, repo *repo_model.Repository, treePath, ref
214214
if err != nil {
215215
return nil, err
216216
}
217-
contentsResponse.SubmoduleGitURL = &submodule.URL
217+
if submodule != nil && submodule.URL != "" {
218+
contentsResponse.SubmoduleGitURL = &submodule.URL
219+
}
218220
}
219221
// Handle links
220222
if entry.IsRegular() || entry.IsLink() {

0 commit comments

Comments
 (0)