Handle case where <set> element is not returned

This commit is contained in:
JC Brand 2017-12-19 14:32:23 +00:00
parent 21241c5cff
commit a0ba972468

View File

@ -341,8 +341,11 @@
_converse.connection.deleteHandler(message_handler);
if (_.isFunction(callback)) {
const set = iq.querySelector('set');
const rsm = new Strophe.RSM({xml: set});
_.extend(rsm, _.pick(options, _.concat(MAM_ATTRIBUTES, ['max'])));
let rsm;
if (!_.isUndefined(set)) {
rsm = new Strophe.RSM({xml: set});
_.extend(rsm, _.pick(options, _.concat(MAM_ATTRIBUTES, ['max'])));
}
callback(messages, rsm);
}
},