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

Fix iOS and macOS Forced unwrap null value HTTPCookie for CookieManager.setCookie #1677

Merged
merged 6 commits into from
Nov 10, 2023

Conversation

maxmitz
Copy link
Contributor

@maxmitz maxmitz commented May 31, 2023

Connection with issue(s)

No issue created

Testing and Review Notes

v6.0.0-beta.23 an error is thrown here:

let cookie = HTTPCookie(properties: properties)!

A force unwrap is done on a value that can be null. The PR wraps a null check around it.

Bildschirmfoto 2023-05-31 um 11 19 09

maxmitz added 2 commits May 31, 2023 09:50
Added force unwrap fix
Updated force unwrap
@pichillilorenzo
Copy link
Owner

@maxmitz could you post a code example to replicate this issue? It should always work. If it doesn’t work, than there is something wrong before creating the cookie.

@AlexT84
Copy link
Contributor

AlexT84 commented Aug 2, 2023

@maxmitz could you post a code example to replicate this issue? It should always work. If it doesn’t work, than there is something wrong before creating the cookie.

Even if it will always work it will never pass the swift lint, the force unwrap should never be used, this is why swift has guard statement and if let statement.

Max Zimmermann and others added 3 commits October 5, 2023 13:33
@pichillilorenzo pichillilorenzo changed the title Forced unwrap null value solved (iOS) Fixed iOS and macOS Forced unwrap null value HTTPCookie for CookieManager.setCookie Nov 10, 2023
@pichillilorenzo pichillilorenzo changed the title Fixed iOS and macOS Forced unwrap null value HTTPCookie for CookieManager.setCookie Fix iOS and macOS Forced unwrap null value HTTPCookie for CookieManager.setCookie Nov 10, 2023
@pichillilorenzo pichillilorenzo merged commit c98a92d into pichillilorenzo:master Nov 10, 2023
1 check passed
@pichillilorenzo
Copy link
Owner

@all-contributors please add @maxmitz for code

Copy link
Contributor

@pichillilorenzo

I've put up a pull request to add @maxmitz! 🎉

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.

3 participants