Skip to content
Snippets Groups Projects
Unverified Commit 523a8661 authored by Jeong Arm's avatar Jeong Arm Committed by GitHub
Browse files

Fix account serializer crash if account doesn't have a user (#23428)

parent bb89f0af
No related branches found
No related tags found
No related merge requests found
......@@ -125,10 +125,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
end
def roles
if object.suspended?
if object.suspended? || object.user.nil?
[]
else
[object.user.role].compact.filter { |role| role.highlighted? }
[object.user.role].compact.filter(&:highlighted?)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment