Skip to content
Extraits de code Groupes Projets
Valider a750d1aa rédigé par ThibG's avatar ThibG Validation de Eugen Rochko
Parcourir les fichiers

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
parent d23a7f97
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -22,7 +22,7 @@ export default class DisplayName extends React.PureComponent {
suffix = `+${others.size - 2}`;
}
} else {
if (others) {
if (others && others.size > 0) {
account = others.first();
} else {
account = this.props.account;
......
......@@ -325,7 +325,7 @@ class Status extends ImmutablePureComponent {
);
}
if (otherAccounts) {
if (otherAccounts && otherAccounts.size > 0) {
statusAvatar = <AvatarComposite accounts={otherAccounts} size={48} />;
} else if (account === undefined || account === null) {
statusAvatar = <Avatar account={status.get('account')} size={48} />;
......
......@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter