From 8e7fc7ec73c0743df378403ad2e704c9fae70400 Mon Sep 17 00:00:00 2001 From: ThibG Date: Tue, 19 Feb 2019 20:00:41 +0100 Subject: 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 --- app/models/account_conversation.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/models') 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 -- cgit