make sure there are actually media attachments before trying to match againist the `filter_undescribed?` setting

master
multiple creatures 2020-01-17 14:29:24 -06:00
parent b93a9a126b
commit f083ab1a27
1 changed files with 1 additions and 1 deletions

View File

@ -59,7 +59,7 @@ class StatusFilter
return false if mentioned_account_ids.include?(account.id)
# Filter posts missing media descriptions.
return true if account.user.filter_undescribed? && status.media_attachments.all? { |attachment| attachment.description.blank? }
return true if account.user.filter_undescribed? && status.media_attachments.present? && status.media_attachments.all? { |attachment| attachment.description.blank? }
return true if account.user_hides_mentions_of_blocked? && mentioned_accounts.where.not(suspended_at: nil).exists?