Browse Source

API: Fix null pointer in attempt to Sudo if not logged in (#5872)

Signed-off-by: Andrew Thornton <art27@cantab.net>
tags/v1.9.0-dev
zeripath 5 years ago
parent
commit
bf47f70c3b
No account linked to committer's email address
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      routers/api/v1/api.go

+ 1
- 1
routers/api/v1/api.go View File

@@ -85,7 +85,7 @@ func sudo() macaron.Handler {
}

if len(sudo) > 0 {
if ctx.User.IsAdmin {
if ctx.IsSigned && ctx.User.IsAdmin {
user, err := models.GetUserByName(sudo)
if err != nil {
if models.IsErrUserNotExist(err) {

Loading…
Cancel
Save