Skip to content
Snippets Groups Projects
Commit e0509587 authored by NOGISAKA Sadata's avatar NOGISAKA Sadata Committed by Eugen Rochko
Browse files

Skip some methods in BatchedRemoveStatusService when account is nil (#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.
parent 57483f2f
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,8 @@ class BatchedRemoveStatusService < BaseService
statuses.group_by(&:account_id).each_value do |account_statuses|
account = account_statuses.first.account
next unless account
unpush_from_home_timelines(account, account_statuses)
unpush_from_list_timelines(account, account_statuses)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment