Skip to content

Commit c216a3b

Browse files
committed
no nil error
1 parent d3e8387 commit c216a3b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

models/user.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,9 @@ func (u *User) GetEmail() string {
234234

235235
// APIFormat converts a User to api.User
236236
func (u *User) APIFormat() *api.User {
237+
if u == nil {
238+
return nil
239+
}
237240
return &api.User{
238241
ID: u.ID,
239242
UserName: u.Name,

0 commit comments

Comments
 (0)