Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NoMethodError in LinkTokenCreateRequest#list_invalid_properties #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rubendinho
Copy link

@rubendinho rubendinho commented Mar 22, 2022

When supplied country_codes of nil, the list_invalid_properties will raise NoMethodError because #length is being called on nil.

request = ::Plaid::LinkTokenCreateRequest.new(products: ['transactions'])

request.valid? # => false

request.list_invalid_properties # => NoMethodError: undefined method `length' for nil:NilClass

When `country_codes` is nil, the `list_invalid_properties` method will error with a NoMethodError since you cannot call `#length` on `nil`.

```
request = ::Plaid::LinkTokenCreateRequest.new(products: ['transactions'])
request.valid? # false
request.list_invalid_properties # NoMethodError: undefined method `length' for nil:NilClass
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant