fix: time can be nil when creating chapter menu (#243)

This commit is contained in:
christoph-heinrich
2022-09-22 22:16:15 +02:00
committed by GitHub
parent 1df7a47005
commit bbe32ba65a

View File

@@ -4390,6 +4390,7 @@ mp.add_key_binding(nil, 'chapters', create_self_updating_menu_opener({
}
items[#items + 1] = item
end
if not state.time then return items end
for index = #items, 1, -1 do
if state.time >= items[index].value then
items[index].active = true