Skip to content

Commit 9311c46

Browse files
nosadaGargron
authored andcommitted
Skip some methods in BatchedRemoveStatusService when account is nil (mastodon#10095)
* Skip some methods in BatchedRemoveStatusService when account is nil Sometimes `bin/tootctl accounts cull` fails with below error: undefined method `followers_for_local_distribution' for nil:NilClass (NoMethodError) This commit makes BatchedRemoveStatusService to skip below methods when `account` is nil: - unpush_from_home_timelines() - unpush_from_list_timelines() - batch_stream_entries() * Fix rubocop error: Use `next` to skip iteration.
1 parent d88a49d commit 9311c46

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

app/services/batched_remove_status_service.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ def call(statuses, **options)
3535
statuses.group_by(&:account_id).each_value do |account_statuses|
3636
account = account_statuses.first.account
3737

38+
next unless account
39+
3840
unpush_from_home_timelines(account, account_statuses)
3941
unpush_from_list_timelines(account, account_statuses)
4042

0 commit comments

Comments
 (0)