A platform for community discussion. Free, open, simple.
FIX: raise `Discourse::NotFound` unless the user is present
Arpit Jalan61eff22b29c4
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rbindex ae1ecff512d..887796e4262 100644--- a/app/controllers/topics_controller.rb+++ b/app/controllers/topics_controller.rb@@ -500,9 +500,10 @@ class TopicsController < ApplicationControllerdef remove_allowed_userparams.require(:username)topic = Topic.find_by(id: params[:topic_id])+ raise Discourse::NotFound unless topicuser = User.find_by(username: params[:username])+ raise Discourse::NotFound unless user- raise Discourse::NotFound unless topicguardian.ensure_can_remove_allowed_users!(topic, user)if topic.remove_allowed_user(current_user, user)