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:
1 parent
4243d06761
commit
7b91bf7f20
1 file changed
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user