diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_net.rb | 2 | ||||
-rw-r--r-- | lib/gitlab_shell.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index 0b99706..d47209e 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -22,7 +22,7 @@ class GitlabNet def discover(key) key_id = key.gsub("key-", "") resp = get("#{host}/discover?key_id=#{key_id}") - JSON.parse(resp.body) + JSON.parse(resp.body) rescue nil end def check diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index 842714e..abc5ac2 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -26,7 +26,7 @@ class GitlabShell end else user = api.discover(@key_id) - puts "Welcome to GitLab, #{user['name']}!" + puts "Welcome to GitLab, #{user && user['name'] || 'Anonymous'}!" end end |