Fix possible crash when a post references an invalid media attachment (#18211)

lolsob-rspec
Claire 2022-05-01 00:55:26 +02:00 committed by GitHub
parent e05fea8dad
commit a31975d369
1 changed files with 1 additions and 1 deletions

View File

@ -254,7 +254,7 @@ class Status < ApplicationRecord
media_attachments media_attachments
else else
map = media_attachments.index_by(&:id) map = media_attachments.index_by(&:id)
ordered_media_attachment_ids.map { |media_attachment_id| map[media_attachment_id] } ordered_media_attachment_ids.filter_map { |media_attachment_id| map[media_attachment_id] }
end end
end end