From 31df012968bd0acb3ed6748c7bf0f99d8ecc4031 Mon Sep 17 00:00:00 2001 From: Cirno the Strongest <1447794+CirnoT@users.noreply.github.com> Date: Sat, 23 May 2020 21:49:48 +0200 Subject: Properly handle and return empty string for dangling commits in GetBranchName (#11587) --- routers/repo/commit.go | 1 + 1 file changed, 1 insertion(+) (limited to 'routers/repo/commit.go') 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) } -- cgit v1.2.3