Skip to content
Snippets Groups Projects
Unverified Commit 6e4d932d authored by Claire's avatar Claire Committed by GitHub
Browse files

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

parent 5a48bf10
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment