Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Crash unwrapping nil host in getCookies (iOS) #110

Closed
TSedlar opened this issue Jun 2, 2019 · 2 comments
Closed

Crash unwrapping nil host in getCookies (iOS) #110

TSedlar opened this issue Jun 2, 2019 · 2 comments
Labels

Comments

@TSedlar
Copy link

TSedlar commented Jun 2, 2019

It seems when the host is null, the cookie manager crashes the application while trying to unwrap the value. I noticed this due to wanting to grab cookies, but the code executed while the page was still on 'about:blank'

It happens on this line

I'm not that versed in swift, but have applied these changed to MyCookieManager.swift:

public static func getCookies(url: String, result: @escaping FlutterResult) {
    var cookieList: [[String: Any]] = []
    let host = URL(string: url)!.host;
    if host != nil {
        MyCookieManager.httpCookieStore!.getAllCookies { (cookies) in
            for cookie in cookies {
                if cookie.domain.contains(host!) {
                    cookieList.append([
                        "name": cookie.name,
                        "value": cookie.value
                    ])
                }
            }
            result(cookieList)
        }
    }
}

If this code looks fine I can make a PR.

This was referenced Jul 6, 2020
Copy link

github-actions bot commented Oct 7, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 22, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant