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

Update Toggles to not throw incorrectParameterSize error when decrypting empty strings #23

Merged
merged 2 commits into from
Nov 23, 2023

Conversation

AlexLotsu
Copy link
Contributor

@AlexLotsu AlexLotsu commented Nov 23, 2023

Update Toggles to not throw incorrectParameterSize error when decrypting empty strings

I have gone with a statement to check for an empty string rather than catch the incorrectParameterSize error.

This is so only the case where "" is passed in will be ignored (if the option is selected in the CipherConfiguration)

If the incorrectParameterSize error is thrown for any other reason it will still be raised.

…ing empty strings

Update Toggles to not throw incorrectParameterSize error when decrypting empty strings
@@ -42,6 +44,11 @@ extension ToggleManager {
guard let cipherConfiguration = cipherConfiguration else {
throw FetchError.missingCipherConfiguration
}

if value == "" && cipherConfiguration.ignoreEmptyStrings {

Choose a reason for hiding this comment

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

Suggested change
if value == "" && cipherConfiguration.ignoreEmptyStrings {
if value.isEmpty && cipherConfiguration.ignoreEmptyStrings {

@albertodebortoli albertodebortoli merged commit bef904a into TogglesPlatform:main Nov 23, 2023
6 checks passed
@albertodebortoli albertodebortoli added this to the 0.6 milestone Feb 26, 2024
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

3 participants