Commit e45bd5fc authored by JC Brand's avatar JC Brand

converse-roomslist: Handle bookmark not existing

parent 02e50ca3
...@@ -141,12 +141,13 @@ converse.plugins.add('converse-roomslist', { ...@@ -141,12 +141,13 @@ converse.plugins.add('converse-roomslist', {
getRoomsListElementName () { getRoomsListElementName () {
if (this.model.get('bookmarked') && _converse.bookmarks) { if (this.model.get('bookmarked') && _converse.bookmarks) {
const bookmark = _.head(_converse.bookmarks.where({'jid': this.model.get('jid')})); const bookmark = _converse.bookmarks.findWhere({'jid': this.model.get('jid')});
if (bookmark) {
return bookmark.get('name'); return bookmark.get('name');
} else {
return this.model.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