Fix actions being ran with no students

master
rubenwardy 2019-11-24 20:47:52 +00:00
parent cbf8ac2f77
commit ff1c654884
1 changed files with 5 additions and 2 deletions

View File

@ -141,6 +141,9 @@ function classroom.get_students_by_selector(selector)
end
function classroom.run_action(aname, runner, selector, params)
local action = _action_by_name[aname]
action.func(runner, classroom.get_students_by_selector(selector))
local action = _action_by_name[aname]
local students = classroom.get_students_by_selector(selector)
if #students > 0 then
action.func(runner, students)
end
end