summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorCirno the Strongest <1447794+CirnoT@users.noreply.github.com>2020-05-23 21:49:48 +0200
committerGitHub <noreply@github.com>2020-05-23 20:49:48 +0100
commit31df012968bd0acb3ed6748c7bf0f99d8ecc4031 (patch)
treed8a7a2798249129205734e086cd8f01e773de582 /routers
parent723b1992711dc55548f0014552cc3b0a98bb86e8 (diff)
downloadgitea-31df012968bd0acb3ed6748c7bf0f99d8ecc4031.tar.gz
gitea-31df012968bd0acb3ed6748c7bf0f99d8ecc4031.zip
Properly handle and return empty string for dangling commits in GetBranchName (#11587)
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/commit.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/commit.go b/routers/repo/commit.go
index a7a8d30d09..d87d220f24 100644
--- a/routers/repo/commit.go
+++ b/routers/repo/commit.go
@@ -309,6 +309,7 @@ func Diff(ctx *context.Context) {
ctx.Data["BranchName"], err = commit.GetBranchName()
if err != nil {
ctx.ServerError("commit.GetBranchName", err)
+ return
}
ctx.HTML(200, tplCommitPage)
}