Merge pull request #338 from pachmu/master

Fix nil pointer on User String method
This commit is contained in:
Kirill Zhuharev 2020-05-24 13:51:51 +03:00 committed by GitHub
commit 2339ed4639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,6 +64,9 @@ type User struct {
// It is normally a user's username, but falls back to a first/last
// name as available.
func (u *User) String() string {
if u == nil {
return ""
}
if u.UserName != "" {
return u.UserName
}