]> source.dussan.org Git - gitea.git/commit
Fix 500 when getting user as unauthenticated user (#8653)
authorMonty Taylor <mordred@inaugust.com>
Thu, 24 Oct 2019 01:18:41 +0000 (10:18 +0900)
committerLunny Xiao <xiaolunwen@gmail.com>
Thu, 24 Oct 2019 01:18:41 +0000 (09:18 +0800)
commitee7b153dd96213a36e1073a38c4c4439851ebd85
tree00d0510994a7003c99f6ca7590eb6d2501bd8d98
parentc84174b7640c17c85c8e3bb86c02cd39b09822e1
Fix 500 when getting user as unauthenticated user (#8653)

When doing GET /api/v1/users/{user} as an unauthenticated user,
gitea throws a 500 because it's trying to dereference elements
from the context user. It wants to do this to see whether to
show the primary email and will do that if the logged in user
is admin or the user in question. However, if ctx.User is nil,
go gets really unhappy.
routers/api/v1/user/user.go