Skip to content

Commit

Permalink
Add nil check for Ruby 2.3
Browse files Browse the repository at this point in the history
It's possible for `filters` to be `nil`, which causes Ruby 2.3 to raise
an error: `TypeError: can't dup NilClass`
  • Loading branch information
joeltaylor committed Apr 6, 2021
1 parent e5ed86c commit de9c3de
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion lib/stripe/api_operations/list.rb
Expand Up @@ -11,7 +11,7 @@ def list(filters = {}, opts = {})

# set filters so that we can fetch the same limit, expansions, and
# predicates when accessing the next and previous pages
obj.filters = filters.dup
obj.filters = filters.dup unless filters.nil?
obj
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/stripe/oauth.rb
Expand Up @@ -10,7 +10,6 @@ def self.execute_resource_request(method, url, params, opts)
opts[:client] ||= opts[:client] || StripeClient.active_client
opts[:api_base] ||= opts[:client].config.connect_base

opts.delete(:client)
super(method, url, params, opts)
end
end
Expand Down

0 comments on commit de9c3de

Please sign in to comment.