about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2021-08-08 22:31:02 +0900
committerGitHub <noreply@github.com>2021-08-08 15:31:02 +0200
commit590e1578bf67fc4defa326b01590f5b817b8818e (patch)
treeb640438dd5bc78af50106c621970d7b48b386073 /app/workers
parent763ab0c7eb5430235ca8a354d11e00de1d8ba6dd (diff)
Fix when MoveWorker cannot get locale from remote account (#16576)
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/move_worker.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/workers/move_worker.rb b/app/workers/move_worker.rb
index 53a6b87f1..cc2c17d32 100644
--- a/app/workers/move_worker.rb
+++ b/app/workers/move_worker.rb
@@ -47,7 +47,7 @@ class MoveWorker
 
   def copy_account_notes!
     AccountNote.where(target_account: @source_account).find_each do |note|
-      text = I18n.with_locale(note.account.user.locale || I18n.default_locale) do
+      text = I18n.with_locale(note.account.user&.locale || I18n.default_locale) do
         I18n.t('move_handler.copy_account_note_text', acct: @source_account.acct)
       end
 
@@ -84,7 +84,7 @@ class MoveWorker
 
   def add_account_note_if_needed!(account, id)
     unless AccountNote.where(account: account, target_account: @target_account).exists?
-      text = I18n.with_locale(account.user.locale || I18n.default_locale) do
+      text = I18n.with_locale(account.user&.locale || I18n.default_locale) do
         I18n.t(id, acct: @source_account.acct)
       end
       AccountNote.create!(account: account, target_account: @target_account, comment: text)