Skip to content

Commit 96237d8

Browse files
noellabokadoshita
authored andcommitted
Fix when MoveWorker cannot get locale from remote account (mastodon#16576)
1 parent cc64f5e commit 96237d8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

app/workers/move_worker.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def queue_follow_unfollows!
4747

4848
def copy_account_notes!
4949
AccountNote.where(target_account: @source_account).find_each do |note|
50-
text = I18n.with_locale(note.account.user.locale || I18n.default_locale) do
50+
text = I18n.with_locale(note.account.user&.locale || I18n.default_locale) do
5151
I18n.t('move_handler.copy_account_note_text', acct: @source_account.acct)
5252
end
5353

@@ -84,7 +84,7 @@ def carry_mutes_over!
8484

8585
def add_account_note_if_needed!(account, id)
8686
unless AccountNote.where(account: account, target_account: @target_account).exists?
87-
text = I18n.with_locale(account.user.locale || I18n.default_locale) do
87+
text = I18n.with_locale(account.user&.locale || I18n.default_locale) do
8888
I18n.t(id, acct: @source_account.acct)
8989
end
9090
AccountNote.create!(account: account, target_account: @target_account, comment: text)

0 commit comments

Comments
 (0)