mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-18 15:48:22 +00:00
Fix possible crash when a post references an invalid media attachment (#18211)
This commit is contained in:
parent
5a48bf1085
commit
6e4d932da5
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue