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

Allow setting associations to nil #193

Merged
merged 1 commit into from Jan 27, 2017
Merged

Allow setting associations to nil #193

merged 1 commit into from Jan 27, 2017

Conversation

jsteiner
Copy link
Contributor

Previously the catchall was falling through to the list case and trying
to enumerate nil. This commit adds a guard to the list condition to
ensure that doesn't happen again, then adds a new condition to handle
nil.

I think this should be handling all cases now, so it also removes the
catchall. This way, if it fails in a way we didn't expect, it should
give an obvious failure that there was no matching case.

Fixes #191

Enum.map(original_assoc, &(cast(&1)))

nil ->
nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Previously the catchall was falling through to the list case and trying
to enumerate `nil`. This commit adds a guard to the list condition to
ensure that doesn't happen again, then adds a new condition to handle
`nil`.

I _think_ this should be handling all cases now, so it also removes the
catchall. This way, if it fails in a way we didn't expect, it should
give an obvious failure that there was no matching case.

Fixes #191
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.

None yet

2 participants