mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01: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
|
||||
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user