1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-10 00:49:32 +00:00

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-09 16:06:00 +02:00 committed by sfan5
parent f2311ff514
commit 6bf0edc59c

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)