cocoa-cb: fix crash when no screen is available

instead of force unwrapping and chaining the optional vars in our
containsMouseLocation function, safely unwrap and guard the resulting
var.

Fixes #6062

(cherry picked from commit 6bf0edc59c)
This commit is contained in:
Akemi authored and Jan Ekström committed 2018-09-29 22:22:20 +03:00
1 parent 4243d06761
commit 7b91bf7f20
1 file changed
+1 -1
+1 -1
View File
@@ -233,7 +233,7 @@ class EventsView: NSView {
topMargin = cocoaCB.window.titleBarHeight + 1 + menuBarHeight
}
var vF = window!.screen!.frame
guard var vF = window?.screen?.frame else { return false }
vF.size.height -= topMargin
let vFW = window!.convertFromScreen(vF)