lib/auth_lh.rb in auth-lh-0.6.0 vs lib/auth_lh.rb in auth-lh-0.6.1
- old
+ new
@@ -80,10 +80,14 @@
protected
def self.get_request(action, params={})
response = RestClient.get("#{@endpoint}#{action}", {params: params}.merge(auth_headers))
- JSON.parse(response.body)
+ if response.body == 'null'
+ nil
+ else
+ JSON.parse(response.body)
+ end
end
def self.auth_headers
{ authorization: "Token token=\"#{@access_token}\"" }
end