potential fix for #3189

This commit is contained in:
r888888888
2017-06-29 13:09:33 -07:00
parent 361e98edee
commit d4c89bccfc

View File

@@ -79,8 +79,10 @@ class PostFlag < ApplicationRecord
if params[:creator_name].present?
flagger_id = User.name_to_id(params[:creator_name].strip)
if CurrentUser.can_view_flagger?(flagger_id)
if flagger_id && CurrentUser.can_view_flagger?(flagger_id)
q = q.where("creator_id = ?", flagger_id)
else
q = q.where("false")
end
end