about summary refs log tree commit diff
path: root/app/models/status.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-05-01 00:55:26 +0200
committerGitHub <noreply@github.com>2022-05-01 00:55:26 +0200
commit6e4d932da53ba236699285ce2bdfcfa07b259fa2 (patch)
tree25757ff74fc0f4d002d1c7f322dcecfe3665cf1f /app/models/status.rb
parent5a48bf1085f9fd4f10ea3706bacfe3b18fcc725c (diff)
Fix possible crash when a post references an invalid media attachment (#18211)
Diffstat (limited to 'app/models/status.rb')
-rw-r--r--app/models/status.rb2
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