We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 3f87525 commit 6554d51Copy full SHA for 6554d51
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