Skip to content

Commit

Permalink
fix #15104 (#15106)
Browse files Browse the repository at this point in the history
Signed-off-by: a1012112796 <[email protected]>
  • Loading branch information
a1012112796 authored Mar 22, 2021
1 parent 2f09e57 commit a6290f6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/convert/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ 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,
Expand Down

0 comments on commit a6290f6

Please sign in to comment.