summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-08 21:49:59 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-05-08 21:49:59 +0300
commit32875f9aaf2c18e11a0af59e389b37ba520dd584 (patch)
tree0575b23fea0eee166f8d5cbb6c2d2cf9765181e8 /lib
parent8c1201efac2cfe521decf6fa330338c9c86651b4 (diff)
parent04561011177f5323f4fe0e18e7a0137d72b314ea (diff)
downloadgitlab-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.rb6
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