Skip to content

A platform for community discussion. Free, open, simple.

FIX: raise invalid params for bad callback

Sam6a54da090215
diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb
index 5ef668485ec..259f74db544 100644
--- a/app/controllers/groups_controller.rb
+++ b/app/controllers/groups_controller.rb
@@ -69,7 +69,11 @@ class GroupsController < ApplicationController
end
if type = params[:type]&.to_sym
- groups = TYPE_FILTERS[type].call(groups, current_user)
+ callback = TYPE_FILTERS[type]
+ if !callback
+ raise Discourse::InvalidParameters.new(:type)
+ end
+ groups = callback.call(groups, current_user)
end
if current_user