We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa46d66 commit 4ed32e7Copy full SHA for 4ed32e7
routers/web/repo/view.go
@@ -902,10 +902,14 @@ func renderCode(ctx *context.Context) {
902
ctx.Data["PageIsViewCode"] = true
903
904
if ctx.Repo.Repository.IsEmpty {
905
- reallyEmpty, err := ctx.Repo.GitRepo.IsEmpty()
906
- if err != nil {
907
- ctx.ServerError("GitRepo.IsEmpty", err)
908
- return
+ reallyEmpty := true
+ var err error
+ if ctx.Repo.GitRepo != nil {
+ reallyEmpty, err = ctx.Repo.GitRepo.IsEmpty()
909
+ if err != nil {
910
+ ctx.ServerError("GitRepo.IsEmpty", err)
911
+ return
912
+ }
913
}
914
if reallyEmpty {
915
ctx.HTML(http.StatusOK, tplRepoEMPTY)
0 commit comments