osc: fix last potential race condition on key events

This commit is contained in:
Ricardo Constantino 2017-04-15 17:53:24 +01:00
parent 676570a643
commit 82bf4567f9
No known key found for this signature in database
GPG Key ID: EFD16019AE4FF531
1 changed files with 2 additions and 1 deletions

View File

@ -2086,7 +2086,8 @@ function process_event(source, what)
end
--reset active element
if not (elements[n].eventresponder["reset"] == nil) then
if not (n > #elements) and elements[n].eventresponder ~= nil and
elements[n].eventresponder["reset"] ~= nil then
elements[n].eventresponder["reset"](elements[n])
end