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

Crash unwrapping nil in injectDeferredObject (iOS) #109

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

Crash unwrapping nil in injectDeferredObject (iOS) #109

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

Comments

@TSedlar
Copy link

TSedlar commented Jun 2, 2019

I was unable to get the stack trace via running through flutter and had to get it through XCode.

The lines are located here in InAppWebViewer.swift

I have limited swift knowledge, but tried to fix it myself and the error does not seem to occur when I replace the code with the following:

if error != nil {
    do {
        let userInfo = (error! as NSError).userInfo
        let srcURL = userInfo["WKJavaScriptExceptionSourceURL"]
        let lineNum = userInfo["WKJavaScriptExceptionLineNumber"]
        let msg = userInfo["WKJavaScriptExceptionMessage"]
        self.onConsoleMessage(sourceURL: (srcURL as? URL)?.absoluteString ?? "", lineNumber: lineNum as? Int ?? -1, message: msg as? String ?? "unknown", messageLevel: "ERROR")
    } catch {
        print("error @ injectDeferredObject")
    }
}

I'm sure there should be a more correct way to fix it, but I figured I would just bring about this issue here anyways.

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant