summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/gitlab_lfs_authentication.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab_lfs_authentication.rb b/lib/gitlab_lfs_authentication.rb
index 196cdd7..96d06d8 100644
--- a/lib/gitlab_lfs_authentication.rb
+++ b/lib/gitlab_lfs_authentication.rb
@@ -11,8 +11,12 @@ class GitlabLfsAuthentication
end
def self.build_from_json(json)
- values = JSON.parse(json) rescue nil
- self.new(values['username'], values['lfs_token'], values['repository_http_path'])
+ begin
+ values = JSON.parse(json)
+ self.new(values['username'], values['lfs_token'], values['repository_http_path'])
+ rescue
+ nil
+ end
end
def authentication_payload