Skip to content

Commit

Permalink
Fix crash when marking statuses as sensitive while some statuses are …
Browse files Browse the repository at this point in the history
…deleted

Fixes mastodon#21910
  • Loading branch information
ClearlyClaire committed Dec 15, 2022
1 parent 62d03bb commit 0aa4828
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/admin/status_batch_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def handle_mark_as_sensitive!
# Can't use a transaction here because UpdateStatusService queues
# Sidekiq jobs
statuses.includes(:media_attachments, :preview_cards).find_each do |status|
next unless status.with_media? || status.with_preview_card?
next if status.discarded? || !(status.with_media? || status.with_preview_card?)

authorize([:admin, status], :update?)

Expand Down

0 comments on commit 0aa4828

Please sign in to comment.