Skip to content

Commit

Permalink
fix wrong system notice when repository is empty (#9010)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and zeripath committed Nov 15, 2019
1 parent 21ae983 commit c0c2624
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions routers/repo/middlewares.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import (

// SetEditorconfigIfExists set editor config as render variable
func SetEditorconfigIfExists(ctx *context.Context) {
if ctx.Repo.Repository.IsEmpty {
ctx.Data["Editorconfig"] = nil
return
}

ec, err := ctx.Repo.GetEditorconfig()

if err != nil && !git.IsErrNotExist(err) {
Expand Down

0 comments on commit c0c2624

Please sign in to comment.