parent
eeaa9250e0
commit
9aa13c585e
1 changed files with 8 additions and 4 deletions
|
@ -856,11 +856,15 @@ func renderCode(ctx *context.Context) {
|
||||||
ctx.Data["PageIsViewCode"] = true
|
ctx.Data["PageIsViewCode"] = true
|
||||||
|
|
||||||
if ctx.Repo.Repository.IsEmpty {
|
if ctx.Repo.Repository.IsEmpty {
|
||||||
reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
|
reallyEmpty := true
|
||||||
|
var err error
|
||||||
|
if ctx.Repo.GitRepo != nil {
|
||||||
|
reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("GitRepo.IsEmpty", err)
|
ctx.ServerError("GitRepo.IsEmpty", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if reallyEmpty {
|
if reallyEmpty {
|
||||||
ctx.HTML(http.StatusOK, tplRepoEMPTY)
|
ctx.HTML(http.StatusOK, tplRepoEMPTY)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue