diff options
author | ThibG <thib@sitedethib.com> | 2019-02-19 20:00:41 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2019-02-19 20:00:41 +0100 |
commit | 8e7fc7ec73c0743df378403ad2e704c9fae70400 (patch) | |
tree | 1854973cf6c756f433664de7020e3ae1f8c3cabc /app/javascript | |
parent | 359d26a05345895f295a91b7728fe711cd280f84 (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/javascript')
-rw-r--r-- | app/javascript/mastodon/components/display_name.js | 2 | ||||
-rw-r--r-- | app/javascript/mastodon/components/status.js | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/javascript/mastodon/components/display_name.js b/app/javascript/mastodon/components/display_name.js index 32809778a..6b9dd6f81 100644 --- a/app/javascript/mastodon/components/display_name.js +++ b/app/javascript/mastodon/components/display_name.js @@ -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; diff --git a/app/javascript/mastodon/components/status.js b/app/javascript/mastodon/components/status.js index 3e98d374b..6270d3c92 100644 --- a/app/javascript/mastodon/components/status.js +++ b/app/javascript/mastodon/components/status.js @@ -326,7 +326,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} />; |