mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-10 01:25:15 +00:00
Fix account serializer crash if account doesn't have a user (#23428)
This commit is contained in:
parent
bb89f0af8a
commit
523a86618f
|
@ -125,10 +125,10 @@ class REST::AccountSerializer < ActiveModel::Serializer
|
||||||
end
|
end
|
||||||
|
|
||||||
def roles
|
def roles
|
||||||
if object.suspended?
|
if object.suspended? || object.user.nil?
|
||||||
[]
|
[]
|
||||||
else
|
else
|
||||||
[object.user.role].compact.filter { |role| role.highlighted? }
|
[object.user.role].compact.filter(&:highlighted?)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue