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:
parent
f2311ff514
commit
6bf0edc59c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user