aboutsummaryrefslogtreecommitdiffstats
path: root/modules/convert/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/convert/user.go')
-rw-r--r--modules/convert/user.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/convert/user.go b/modules/convert/user.go
index c75a8aac52..010c92b969 100644
--- a/modules/convert/user.go
+++ b/modules/convert/user.go
@@ -13,6 +13,9 @@ import (
// ToUser convert models.User to api.User
// signed shall only be set if requester is logged in. authed shall only be set if user is site admin or user himself
func ToUser(user *models.User, signed, authed bool) *api.User {
+ if user == nil {
+ return nil
+ }
result := &api.User{
ID: user.ID,
UserName: user.Name,