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

Exception handling for Rails multiparam attribute #66

Open
ilyakatz opened this issue May 22, 2019 · 0 comments
Open

Exception handling for Rails multiparam attribute #66

ilyakatz opened this issue May 22, 2019 · 0 comments

Comments

@ilyakatz
Copy link

Looks like this change introduced a bug

https://github.com/jackc/tod/blob/master/lib/tod/time_of_day.rb#L213

In some cases, values for individual values can be nil which breaks the initialization.

I propose adding default values if any of the results are undefined

::Tod::TimeOfDay.new(time_of_day[4] || 0, time_of_day[5] || 0, time_of_day[6] || 0)
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

No branches or pull requests

1 participant