1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 04:45:33 +00:00

osc: paint over a crash

Sometimes tries to index a nil object when seeking close to the end of
the file. See #1101.
This commit is contained in:
wm4 2015-04-22 18:52:55 +02:00
parent 777273c064
commit 589533d97a

View File

@ -266,11 +266,13 @@ end
-- get the currently selected track of <type>, OSC-style counted
function get_track(type)
local track = mp.get_property(type)
if (track == "no" or track == nil) then
return 0
else
return tracks_mpv[type][tonumber(track)].osc_id
if track ~= "no" and track ~= nil then
local tr = tracks_mpv[type][tonumber(track)]
if tr then
return tr.osc_id
end
end
return 0
end