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
commit 14516d3e7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);