Commit 3c9ef9eb authored by Patricio Cano's avatar Patricio Cano

Properly rescue from JSON parse.

parent a070ae4a
...@@ -11,8 +11,12 @@ class GitlabLfsAuthentication ...@@ -11,8 +11,12 @@ class GitlabLfsAuthentication
end end
def self.build_from_json(json) def self.build_from_json(json)
values = JSON.parse(json) rescue nil begin
self.new(values['username'], values['lfs_token'], values['repository_http_path']) values = JSON.parse(json)
self.new(values['username'], values['lfs_token'], values['repository_http_path'])
rescue
nil
end
end end
def authentication_payload def authentication_payload
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment