Guard against null values when processing tags and serializing tagged objects (#39983)
This commit is contained in:
1 parent
b312d842e8
commit
428fccf04a
2 files changed
+3
-1
No files matched your search
@@ -219,6 +219,8 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||||||
return if @object['tag'].nil?
|
return if @object['tag'].nil?
|
||||||
|
|
||||||
as_array(@object['tag']).each do |tag|
|
as_array(@object['tag']).each do |tag|
|
||||||
|
next if tag.nil?
|
||||||
|
|
||||||
if equals_or_includes?(tag['type'], 'Hashtag')
|
if equals_or_includes?(tag['type'], 'Hashtag')
|
||||||
process_hashtag tag
|
process_hashtag tag
|
||||||
elsif equals_or_includes?(tag['type'], 'Mention')
|
elsif equals_or_includes?(tag['type'], 'Mention')
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
|
|||||||
end
|
end
|
||||||
|
|
||||||
def virtual_tags
|
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
|
end
|
||||||
|
|
||||||
def atom_uri
|
def atom_uri
|
||||||
|
|||||||
Reference in new issue
Block a user