diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-08 21:49:59 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2014-05-08 21:49:59 +0300 |
commit | 32875f9aaf2c18e11a0af59e389b37ba520dd584 (patch) | |
tree | 0575b23fea0eee166f8d5cbb6c2d2cf9765181e8 /lib | |
parent | 8c1201efac2cfe521decf6fa330338c9c86651b4 (diff) | |
parent | 04561011177f5323f4fe0e18e7a0137d72b314ea (diff) | |
download | gitlab-ce-32875f9aaf2c18e11a0af59e389b37ba520dd584.tar.gz |
Merge pull request #6937 from chamill/master
Provide fallback for missing `name` value.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/oauth/user.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index 1bac93378ef..7f1d1cd6532 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -65,7 +65,11 @@ module Gitlab end def name - auth.info.name.to_s.force_encoding("utf-8") + if auth.info.name.nil? + "#{auth.info.first_name} #{auth.info.last_name}".force_encoding('utf-8') + else + auth.info.name.to_s.force_encoding('utf-8') + end end def username |