Merge pull request #4552 from matrix-org/foldleft/fix-sublist-crash

Fix a crash where a name could unexpectedly be an empty list
This commit is contained in:
Zoe
2020-05-06 13:52:50 +01:00
committed by GitHub
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);