Fix a crash where a name could unexpectedly be an empty list

This commit is contained in:
Zoe 2020-05-05 15:39:37 +01:00
parent aa0c6f1f71
commit 781cbea744
2 changed files with 39 additions and 4 deletions

View file

@ -432,10 +432,9 @@ export default createReactClass({
});
let name = this.state.roomName;
if (name == undefined || name == null) name = '';
if (typeof name !== 'string') name = '';
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon
let badge;
if (badges) {
const limitedCount = FormattingUtils.formatCount(notificationCount);