A platform for community discussion. Free, open, simple.
FIX: handle nil topic value when removing allowed users
Arpit Jalan5951e111ad9a
diff --git a/app/controllers/topics_controller.rb b/app/controllers/topics_controller.rbindex 002f2aa0103..6bc4fa406b7 100644--- a/app/controllers/topics_controller.rb+++ b/app/controllers/topics_controller.rb@@ -503,7 +503,7 @@ class TopicsController < ApplicationControlleruser = User.find_by(username: params[:username])guardian.ensure_can_remove_allowed_users!(topic, user)- if topic.remove_allowed_user(current_user, user)+ if topic&.remove_allowed_user(current_user, user)render json: success_jsonelserender json: failed_json, status: 422