1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-16 12:17:12 +00:00

mac/menu: properly guard playlist array access

This commit is contained in:
der richter 2024-03-03 22:53:00 +01:00
parent 30eab4b933
commit 46a9e8c130

View File

@ -342,8 +342,8 @@ class MenuBar: NSObject {
@objc func openPlaylist() {
let panel = NSOpenPanel()
if panel.runModal() == .OK {
"loadlist \"\(panel.urls[0].path)\"".withCString {
if panel.runModal() == .OK, let url = panel.urls.first {
"loadlist \"\(url.path)\"".withCString {
EventsResponder.sharedInstance().queueCommand(UnsafeMutablePointer<CChar>(mutating: $0))
}
}