Browse Source

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

Fix panic when no user is signed in
tags/v1.0.0
Andrey Nering 7 years ago
parent
commit
bd13c81684
1 changed files with 9 additions and 3 deletions
  1. 9
    3
      routers/repo/middlewares.go

+ 9
- 3
routers/repo/middlewares.go 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" {

Loading…
Cancel
Save