mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-12-01 06:16:09 +01:00
Fix Commits nil pointer dereference (#2203)
This commit is contained in:
parent
9a505fafda
commit
1193627014
|
@ -47,6 +47,10 @@ func renderIssueLinks(oldCommits *list.List, repoLink string) *list.List {
|
||||||
// Commits render branch's commits
|
// Commits render branch's commits
|
||||||
func Commits(ctx *context.Context) {
|
func Commits(ctx *context.Context) {
|
||||||
ctx.Data["PageIsCommits"] = true
|
ctx.Data["PageIsCommits"] = true
|
||||||
|
if ctx.Repo.Commit == nil {
|
||||||
|
ctx.Handle(404, "Commit not found", nil)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
commitsCount, err := ctx.Repo.Commit.CommitsCount()
|
commitsCount, err := ctx.Repo.Commit.CommitsCount()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue