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

th-downstream
Claire 3 years ago committed by GitHub
parent e05fea8dad
commit a31975d369

@ -254,7 +254,7 @@ class Status < ApplicationRecord
media_attachments
else
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

Loading…
Cancel
Save