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 6deb6ec commit 5aeecf4Copy full SHA for 5aeecf4
routers/web/repo/view.go
@@ -896,10 +896,14 @@ func renderCode(ctx *context.Context) {
896
ctx.Data["PageIsViewCode"] = true
897
898
if ctx.Repo.Repository.IsEmpty {
899
- reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
900
- if err != nil {
901
- ctx.ServerError("GitRepo.IsEmpty", err)
902
- return
+ reallyEmpty := true
+ var err error
+ if ctx.Repo.GitRepo != nil {
+ reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
903
+ if err != nil {
904
+ ctx.ServerError("GitRepo.IsEmpty", err)
905
+ return
906
+ }
907
}
908
if reallyEmpty {
909
ctx.HTML(http.StatusOK, tplRepoEMPTY)
0 commit comments