0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 11:24:17 +01:00

Merge pull request #196 from Bwko/fix/commit-view-panic

Fix panic when no user is signed in
This commit is contained in:
Andrey Nering 2016-11-19 14:30:37 -02:00 committed by GitHub
commit bd13c81684

View file

@ -23,10 +23,16 @@ func SetEditorconfigIfExists(ctx *context.Context) {
}
func SetDiffViewStyle(ctx *context.Context) {
queryStyle := ctx.Query("style")
if !ctx.IsSigned {
ctx.Data["IsSplitStyle"] = queryStyle == "split"
return
}
var (
userStyle = ctx.User.DiffViewStyle
queryStyle = ctx.Query("style")
style string
userStyle = ctx.User.DiffViewStyle
style string
)
if queryStyle == "unified" || queryStyle == "split" {