Skip to content

Commit

Permalink
Fix empty wiki (go-gitea#5504) (go-gitea#5508)
Browse files Browse the repository at this point in the history
* fix wiki page when wiki path is exist but empty

* improve the error check
  • Loading branch information
lunny authored and lafriks committed Dec 10, 2018
1 parent ad9f9cd commit 2b4f87d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion routers/repo/wiki.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func findWikiRepoCommit(ctx *context.Context) (*git.Repository, *git.Commit, err

commit, err := wikiRepo.GetBranchCommit("master")
if err != nil {
ctx.ServerError("GetBranchCommit", err)
return wikiRepo, nil, err
}
return wikiRepo, commit, nil
Expand Down Expand Up @@ -111,6 +110,9 @@ func wikiContentsByName(ctx *context.Context, commit *git.Commit, wikiName strin
func renderWikiPage(ctx *context.Context, isViewPage bool) (*git.Repository, *git.TreeEntry) {
wikiRepo, commit, err := findWikiRepoCommit(ctx)
if err != nil {
if !git.IsErrNotExist(err) {
ctx.ServerError("GetBranchCommit", err)
}
return nil, nil
}

Expand Down

0 comments on commit 2b4f87d

Please sign in to comment.