Merge pull request #207 from sgotti/github_handle_empty_user_email
github: handle nil user email
This commit is contained in:
commit
6c9105ddd2
|
@ -197,11 +197,16 @@ func (c *Client) GetUserInfo() (*gitsource.UserInfo, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &gitsource.UserInfo{
|
||||
|
||||
userInfo := &gitsource.UserInfo{
|
||||
ID: strconv.FormatInt(*user.ID, 10),
|
||||
LoginName: *user.Login,
|
||||
Email: *user.Email,
|
||||
}, nil
|
||||
}
|
||||
if user.Email != nil {
|
||||
userInfo.Email = *user.Email
|
||||
}
|
||||
|
||||
return userInfo, nil
|
||||
}
|
||||
|
||||
func (c *Client) GetRepoInfo(repopath string) (*gitsource.RepoInfo, error) {
|
||||
|
|
Loading…
Reference in New Issue