diff --git a/app/serializers/rest/account_serializer.rb b/app/serializers/rest/account_serializer.rb index 62eac1fbdef0908334f5c943ce8a8910f462a850..f6fad9fe145e5424c2a64698a9c6e34f0f18b151 100644 --- a/app/serializers/rest/account_serializer.rb +++ b/app/serializers/rest/account_serializer.rb @@ -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