Skip to content

Commit

Permalink
select.lua: fix select-edition crash on non-MKVs
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
guidocella committed Dec 31, 2024
1 parent 83bb498 commit ba04780
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion player/lua/select.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ba04780

Please sign in to comment.