about summary refs log tree commit diff
path: root/app/models/notification.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/notification.rb')
-rw-r--r--app/models/notification.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/models/notification.rb b/app/models/notification.rb
index 1e64d1ae9..0a5d987cf 100644
--- a/app/models/notification.rb
+++ b/app/models/notification.rb
@@ -68,7 +68,10 @@ class Notification < ApplicationRecord
   class << self
     def reload_stale_associations!(cached_items)
       account_ids = cached_items.map(&:from_account_id).uniq
-      accounts    = Account.where(id: account_ids).map { |a| [a.id, a] }.to_h
+
+      return if account_ids.empty?
+
+      accounts = Account.where(id: account_ids).map { |a| [a.id, a] }.to_h
 
       cached_items.each do |item|
         item.from_account = accounts[item.from_account_id]