Skip to content

Commit

Permalink
Fix panic in PropDef.GetValue for person property types. (mattermos…
Browse files Browse the repository at this point in the history
…t-community#2218)

* Fixed panic in PropDef.GetValue for `person` property types.
- the GetUserByID API can return a nil user and nil error

* return userid
  • Loading branch information
wiggin77 authored Feb 2, 2022
1 parent 5030b1e commit 46801d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/model/properties.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ func (pd PropDef) GetValue(v interface{}, resolver PropValueResolver) (string, e
if err != nil {
return "", err
}
if user == nil {
return userID, nil
}
return user.Username, nil
}
return userID, nil
Expand Down

0 comments on commit 46801d7

Please sign in to comment.