mirror of https://github.com/mpv-player/mpv
mac/menu: properly guard playlist array access
This commit is contained in:
parent
30eab4b933
commit
46a9e8c130
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue