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

UserDefaultsStore does not support nil values #147

Closed
yakovmanshin opened this issue May 12, 2024 · 0 comments · Fixed by #151
Closed

UserDefaultsStore does not support nil values #147

yakovmanshin opened this issue May 12, 2024 · 0 comments · Fixed by #151
Assignees
Labels
bug Something isn’t working
Milestone

Comments

@yakovmanshin
Copy link
Owner

yakovmanshin commented May 12, 2024

Attempting to write nil results in the exception:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Attempt to insert non-property list object null for key FeatureFlagKey'
@yakovmanshin yakovmanshin added the bug Something isn’t working label May 12, 2024
@yakovmanshin yakovmanshin added this to the v4.0.0 milestone May 12, 2024
@yakovmanshin yakovmanshin self-assigned this May 13, 2024
yakovmanshin added a commit that referenced this issue May 13, 2024
* `UserDefaults` does not accept `nil` as the value in a record
* Upon finding a `nil`, `UserDefaults` raises an exception which crashes the client app
* This fix does not add complete support for optionals but addresses the crash by checking the type against the `ExpressibleByNilLiteral` protocol and throwing the `optionalValuesAreNotSupported` error
* Complete support for optionals in `UserDefaultsStore` is planned for #150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant