about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
Diffstat (limited to 'app/services')
-rw-r--r--app/services/activitypub/process_account_service.rb4
-rw-r--r--app/services/resolve_remote_account_service.rb2
2 files changed, 2 insertions, 4 deletions
diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb
index badb26720..a45681078 100644
--- a/app/services/activitypub/process_account_service.rb
+++ b/app/services/activitypub/process_account_service.rb
@@ -15,11 +15,11 @@ class ActivityPub::ProcessAccountService < BaseService
     @account     = Account.find_by(uri: @uri)
     @collections = {}
 
+    old_public_key = @account&.public_key
     create_account  if @account.nil?
     upgrade_account if @account.ostatus?
-    old_public_key = @account.public_key
     update_account
-    RefollowWorker.perform_async(@account.id) if old_public_key != @account.public_key
+    RefollowWorker.perform_async(@account.id) if !old_public_key.nil? && old_public_key != @account.public_key
 
     @account
   rescue Oj::ParseError
diff --git a/app/services/resolve_remote_account_service.rb b/app/services/resolve_remote_account_service.rb
index 753601501..7031c98f5 100644
--- a/app/services/resolve_remote_account_service.rb
+++ b/app/services/resolve_remote_account_service.rb
@@ -85,10 +85,8 @@ class ResolveRemoteAccountService < BaseService
 
   def handle_ostatus
     create_account if @account.nil?
-    old_public_key = @account.public_key
     update_account
     update_account_profile if update_profile?
-    RefollowWorker.perform_async(@account.id) if old_public_key != @account.public_key
   end
 
   def update_profile?