mirror of
https://github.com/discourse/discourse.git
synced 2025-03-04 02:31:55 +08:00
FIX: handle nil topic value when removing allowed users
This commit is contained in:
parent
92100f82eb
commit
5951e111ad
@ -503,7 +503,7 @@ class TopicsController < ApplicationController
|
||||
user = 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_json
|
||||
else
|
||||
render json: failed_json, status: 422
|
||||
|
Loading…
x
Reference in New Issue
Block a user