Bugfix. Attribute error when empty IQ stanza is returned for vCard query

This commit is contained in:
JC Brand 2018-01-30 10:25:08 +01:00
parent 1da5592607
commit 62ad605bec
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 3.3.3 (Unreleased)
- Attribute error when empty IQ stanza is returned for vCard query
## 3.3.2 (2018-01-29)
### Bugfixes

View File

@ -14,8 +14,12 @@
function onVCardData (_converse, jid, iq, callback) {
const vcard = iq.querySelector('vCard'),
img_type = _.get(vcard.querySelector('TYPE'), 'textContent'),
const vcard = iq.querySelector('vCard');
if (_.isNull(vcard)) {
// Some servers return an empty IQ
return onVCardError(_converse, jid, iq, callback);
}
const img_type = _.get(vcard.querySelector('TYPE'), 'textContent'),
img = _.get(vcard.querySelector('BINVAL'), 'textContent'),
url = _.get(vcard.querySelector('URL'), 'textContent'),
fullname = _.get(vcard.querySelector('FN'), 'textContent');