Commit 1269cb72 authored by JC Brand's avatar JC Brand

Don't attempt to fetch a VCard if we don't have a JID

parent 8de55ce6
...@@ -108,9 +108,7 @@ converse.plugins.add('converse-vcard', { ...@@ -108,9 +108,7 @@ converse.plugins.add('converse-vcard', {
model: _converse.VCard, model: _converse.VCard,
initialize () { initialize () {
this.on('add', vcard => { this.on('add', vcard => (vcard.get('jid') && api.vcard.update(vcard)));
api.vcard.update(vcard);
});
} }
}); });
...@@ -336,7 +334,7 @@ converse.plugins.add('converse-vcard', { ...@@ -336,7 +334,7 @@ converse.plugins.add('converse-vcard', {
const jid = model.get('jid'); const jid = model.get('jid');
if (!jid) { if (!jid) {
throw new Error("No JID to get vcard for!"); log.error("No JID to get vcard for");
} }
return getVCard(_converse, jid); return getVCard(_converse, jid);
} else { } else {
......
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