Skip to content

Commit

Permalink
fix submodule is nil panic (#23588)
Browse files Browse the repository at this point in the history
#23587  
submodule path is nil 
It is panic a nil error

---------

Co-authored-by: delvh <[email protected]>
Co-authored-by: KN4CK3R <[email protected]>
  • Loading branch information
3 people authored Mar 20, 2023
1 parent a8c30a4 commit f83246e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/repository/files/content.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit f83246e

Please sign in to comment.