Handle case where bookmark doesn't exist for some reason

This commit is contained in:
JC Brand 2019-08-10 12:06:01 +02:00
parent 135cbcd043
commit aa9aad918f

View File

@ -43,10 +43,11 @@ converse.plugins.add('converse-bookmarks', {
const { _converse } = this.__super__;
if (this.get('bookmarked') && _converse.bookmarks) {
const bookmark = _converse.bookmarks.findWhere({'jid': this.get('jid')});
return bookmark.get('name');
} else {
return this.__super__.getDisplayName.apply(this, arguments);
if (bookmark) {
return bookmark.get('name');
}
}
return this.__super__.getDisplayName.apply(this, arguments);
},
getAndPersistNickname (nick) {