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
This commit is contained in:
Akemi
2018-08-11 12:59:44 +02:00
committed by sfan5
parent f2311ff514
commit 6bf0edc59c
+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)