Skip to content

Commit 162a263

Browse files
committed
fix submodule is nil panic
1 parent ccd3a55 commit 162a263

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

services/repository/files/content.go

Lines changed: 3 additions & 1 deletion
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 {
218+
contentsResponse.SubmoduleGitURL = &submodule.URL
219+
}
218220
}
219221
// Handle links
220222
if entry.IsRegular() || entry.IsLink() {

0 commit comments

Comments
 (0)