diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-05-01 00:55:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-01 00:55:26 +0200 |
commit | 6e4d932da53ba236699285ce2bdfcfa07b259fa2 (patch) | |
tree | 25757ff74fc0f4d002d1c7f322dcecfe3665cf1f /app | |
parent | 5a48bf1085f9fd4f10ea3706bacfe3b18fcc725c (diff) |
Fix possible crash when a post references an invalid media attachment (#18211)
Diffstat (limited to 'app')
-rw-r--r-- | app/models/status.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/status.rb b/app/models/status.rb index 288d374fd..a4e685ce3 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -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 |