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

Speculative fix for crashes in libswiftFoundation.dylib #81

Merged
merged 1 commit into from
May 22, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Shifty/BrowserManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ enum BrowserManager {
logw("Error: Could not get url, app already closed")
return nil
}
guard let window = (browser.windows?() as? [Window])?.first else {
guard let windows = browser.windows?(), windows.count > 0, let window = windows[0] as? Window else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

let window = windows.firstObject would remove the need to check windows.count. It would still do one internally, but it would make the code a bit nicer :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks and done :)

logw("Error: Could not get url, there are no windows")
return nil
}
Expand Down