Fix crash when having no lights groups

When having no groups, case params[:groups] is nil and .each is undefined which throws an error.