Skip to content

Commit 1ddbefb

Browse files
noellaboClearlyClaire
authored andcommitted
Fix when MoveWorker cannot get locale from remote account (mastodon#16576)
1 parent 85c845c commit 1ddbefb

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
@@ -41,7 +41,7 @@ def queue_follow_unfollows!
4141

4242
def copy_account_notes!
4343
AccountNote.where(target_account: @source_account).find_each do |note|
44-
text = I18n.with_locale(note.account.user.locale || I18n.default_locale) do
44+
text = I18n.with_locale(note.account.user&.locale || I18n.default_locale) do
4545
I18n.t('move_handler.copy_account_note_text', acct: @source_account.acct)
4646
end
4747

@@ -72,7 +72,7 @@ def carry_mutes_over!
7272

7373
def add_account_note_if_needed!(account, id)
7474
unless AccountNote.where(account: account, target_account: @target_account).exists?
75-
text = I18n.with_locale(account.user.locale || I18n.default_locale) do
75+
text = I18n.with_locale(account.user&.locale || I18n.default_locale) do
7676
I18n.t(id, acct: @source_account.acct)
7777
end
7878
AccountNote.create!(account: account, target_account: @target_account, comment: text)

0 commit comments

Comments
 (0)