Skip to content

Commit

Permalink
Add null check for twitter description
Browse files Browse the repository at this point in the history
  • Loading branch information
envomer committed Sep 18, 2022
1 parent 3d66163 commit adf11d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion providers/twitterv2/twitterv2.go
Expand Up @@ -136,7 +136,9 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
user.RawData = userInfo.Data
user.Name = user.RawData["name"].(string)
user.NickName = user.RawData["username"].(string)
user.Description = user.RawData["description"].(string)
if user.RawData["description"] != nil {
user.Description = user.RawData["description"].(string)
}
user.AvatarURL = user.RawData["profile_image_url"].(string)
user.UserID = user.RawData["id"].(string)
if user.RawData["location"] != nil {
Expand Down

0 comments on commit adf11d3

Please sign in to comment.