Commit e45bd5fc authored by JC Brand's avatar JC Brand

converse-roomslist: Handle bookmark not existing

parent 02e50ca3
......@@ -141,11 +141,12 @@ converse.plugins.add('converse-roomslist', {
getRoomsListElementName () {
if (this.model.get('bookmarked') && _converse.bookmarks) {
const bookmark = _.head(_converse.bookmarks.where({'jid': this.model.get('jid')}));
return bookmark.get('name');
} else {
return this.model.get('name');
const bookmark = _converse.bookmarks.findWhere({'jid': this.model.get('jid')});
if (bookmark) {
return bookmark.get('name');
}
}
return this.model.get('name');
}
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment