Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/release/v1.16' into release/dc…
Browse files Browse the repository at this point in the history
…s/v1.16
  • Loading branch information
richmahn committed Jul 30, 2022
2 parents 70558e0 + 9aa13c5 commit 0e9fad8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -882,10 +882,14 @@ func renderCode(ctx *context.Context) {
ctx.Data["PageIsViewCode"] = true

if ctx.Repo.Repository.IsEmpty {
reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
if err != nil {
ctx.ServerError("GitRepo.IsEmpty", err)
return
reallyEmpty := true
var err error
if ctx.Repo.GitRepo != nil {
reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
if err != nil {
ctx.ServerError("GitRepo.IsEmpty", err)
return
}
}
if reallyEmpty {
ctx.HTML(http.StatusOK, tplRepoEMPTY)
Expand Down

0 comments on commit 0e9fad8

Please sign in to comment.