mirror of
https://github.com/mastodon/mastodon.git
synced 2026-08-15 19:20:59 -05:00
Guard against null values when processing tags and serializing tagged objects (#39983)
This commit is contained in:
@@ -219,6 +219,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
||||
return if @object['tag'].nil?
|
||||
|
||||
as_array(@object['tag']).each do |tag|
|
||||
next if tag.nil?
|
||||
|
||||
if equals_or_includes?(tag['type'], 'Hashtag')
|
||||
process_hashtag tag
|
||||
elsif equals_or_includes?(tag['type'], 'Mention')
|
||||
|
||||
@@ -139,7 +139,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
||||
end
|
||||
|
||||
def virtual_tags
|
||||
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis + object.tagged_objects.map(&:object)
|
||||
object.active_mentions.to_a.sort_by(&:id) + object.tags + object.emojis + object.tagged_objects.filter_map(&:object)
|
||||
end
|
||||
|
||||
def atom_uri
|
||||
|
||||
Reference in New Issue
Block a user