diff --git a/services/repository/files/content.go b/services/repository/files/content.go index cee5cb0..d1d043e 100644 --- a/services/repository/files/content.go +++ b/services/repository/files/content.go @@ -178,7 +178,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 { + contentsResponse.SubmoduleGitURL = &submodule.URL + } } // Handle links if entry.IsRegular() || entry.IsLink() {