diff options
author | Ricardo Constantino <wiiaboo@gmail.com> | 2016-11-07 19:57:20 +0000 |
---|---|---|
committer | Ricardo Constantino <wiiaboo@gmail.com> | 2016-11-08 21:18:53 +0000 |
commit | 5beb2306904b4437b5acf136b02aeaa073c351c7 (patch) | |
tree | 367b2c7917a9a2604282d67aae6f1542fc4c5e04 /player | |
parent | 616ecd93650ab1e11e22e0e113f5031b66b4b9d4 (diff) |
osc: fix crashes when dragging seekbar across file changes
Fixes #3210
Diffstat (limited to 'player')
-rw-r--r-- | player/lua/osc.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua index a6cdcbe0eb..f42275f5e9 100644 --- a/player/lua/osc.lua +++ b/player/lua/osc.lua @@ -2058,7 +2058,8 @@ function process_event(source, what) if n == 0 then --click on background (does not work) - elseif n > 0 and not (elements[n].eventresponder[source .. "_" .. what] == nil) then + elseif n > 0 and not (n > #elements) and + not (elements[n].eventresponder[source .. "_" .. what] == nil) then if mouse_hit(elements[n]) then elements[n].eventresponder[source .. "_" .. what](elements[n]) @@ -2090,7 +2091,7 @@ function process_event(source, what) local n = state.active_element - if not (elements[n].eventresponder == nil) then + if not (n > #elements) and not (elements[n].eventresponder == nil) then if not (elements[n].eventresponder[source] == nil) then elements[n].eventresponder[source](elements[n]) end |