about summary refs log tree commit diff
path: root/app/models/account_conversation.rb
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-02-19 20:00:41 +0100
committerEugen Rochko <eugen@zeonfederated.com>2019-02-19 20:00:41 +0100
commit8e7fc7ec73c0743df378403ad2e704c9fae70400 (patch)
tree1854973cf6c756f433664de7020e3ae1f8c3cabc /app/models/account_conversation.rb
parent359d26a05345895f295a91b7728fe711cd280f84 (diff)
Fix crash when conversations have no valid participants (#10078)
* Never return empty participants for conversations

Fixes #10068

* Fix client-side crash when conversations have no participants
Diffstat (limited to 'app/models/account_conversation.rb')
-rw-r--r--app/models/account_conversation.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/account_conversation.rb b/app/models/account_conversation.rb
index cc6b39279..0c03747e2 100644
--- a/app/models/account_conversation.rb
+++ b/app/models/account_conversation.rb
@@ -30,7 +30,8 @@ class AccountConversation < ApplicationRecord
     if participant_account_ids.empty?
       [account]
     else
-      Account.where(id: participant_account_ids)
+      participants = Account.where(id: participant_account_ids)
+      participants.empty? ? [account] : participants
     end
   end