Browse Source

Fix Commits nil pointer dereference (#2203)

tags/v1.2.0-rc1
Bwko 6 years ago
parent
commit
1193627014
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      routers/repo/commit.go

+ 4
- 0
routers/repo/commit.go View File

@@ -47,6 +47,10 @@ func renderIssueLinks(oldCommits *list.List, repoLink string) *list.List {
// Commits render branch's commits
func Commits(ctx *context.Context) {
ctx.Data["PageIsCommits"] = true
if ctx.Repo.Commit == nil {
ctx.Handle(404, "Commit not found", nil)
return
}

commitsCount, err := ctx.Repo.Commit.CommitsCount()
if err != nil {

Loading…
Cancel
Save