From cce62b3571617e2df3aee8df4b3b1908191dc495 Mon Sep 17 00:00:00 2001 From: Nick Thomas Date: Thu, 9 Aug 2018 18:27:45 +0100 Subject: Guard discovery by username or key against bad API responses --- lib/gitlab_shell.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/gitlab_shell.rb') diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index c6b28ce..03edf65 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -208,7 +208,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength begin if defined?(@who) @user = api.discover(@who) - @gl_id = "user-#{@user['id']}" if @user + @gl_id = "user-#{@user['id']}" if @user && @user.key?('id') else @user = api.discover(@gl_id) end -- cgit v1.2.1