mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-27 05:10:20 +00:00
select.lua: fix select-edition crash on non-MKVs
In files other than MKVs edition-list is an empty table, not nil. It is current-edition that is nil. However nil still needs to be checked to not crash with mpv --idle.
This commit is contained in:
committed by
Kacper Michajłow
parent
1dd0e49f83
commit
50a3da73b7
@@ -226,7 +226,7 @@ end)
|
||||
mp.add_key_binding(nil, "select-edition", function ()
|
||||
local edition_list = mp.get_property_native("edition-list")
|
||||
|
||||
if edition_list == nil or #edition_list == 1 then
|
||||
if edition_list == nil or #edition_list < 2 then
|
||||
show_error("No available editions.")
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user