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

Prevent crash when types are mismatched #70

Merged
merged 3 commits into from
Mar 3, 2023

Conversation

ejensen
Copy link
Collaborator

@ejensen ejensen commented Feb 22, 2023

Describe your changes

This change prevents a force-casting crash when fetching a wrapped value with mismatched types. nil is returned instead. A mismatched type can be caused by a redefinition of a key or data corruption. The change allows Foil intergrators to handle the nil case rather than crashing. This change does not impact the public interface and adds a unit test to verify mismatched types are handled.

@jessesquires
Copy link
Owner

Thanks @ejensen ! I will take a look at this soon 😊

@jessesquires jessesquires merged commit f88059d into jessesquires:main Mar 3, 2023
@jessesquires
Copy link
Owner

thanks so much @ejensen ! 🙌🏼

@jessesquires
Copy link
Owner

I've sent an invite to make you a collaborator with push access. 🎉

@jessesquires
Copy link
Owner

And this has been released:

https://github.com/jessesquires/Foil/releases/tag/4.0.1

@ejensen ejensen deleted the type-mismatch-crash branch March 6, 2023 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants