Commit a0ba9724 authored by JC Brand's avatar JC Brand

Handle case where <set> element is not returned

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