We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eeaa925 commit b444c8bCopy full SHA for b444c8b
routers/web/repo/view.go
@@ -856,10 +856,14 @@ func renderCode(ctx *context.Context) {
856
ctx.Data["PageIsViewCode"] = true
857
858
if ctx.Repo.Repository.IsEmpty {
859
- reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
860
- if err != nil {
861
- ctx.ServerError("GitRepo.IsEmpty", err)
862
- return
+ reallyEmpty := true
+ var err error
+ if ctx.Repo.GitRepo != nil {
+ reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
863
+ if err != nil {
864
+ ctx.ServerError("GitRepo.IsEmpty", err)
865
+ return
866
+ }
867
}
868
if reallyEmpty {
869
ctx.HTML(http.StatusOK, tplRepoEMPTY)
0 commit comments