Commit 24d86c7e authored by JC Brand's avatar JC Brand

Wrap in try/catch, otherwise handler gets removed upon error

parent 235b24d1
...@@ -784,7 +784,6 @@ ...@@ -784,7 +784,6 @@
.c('publish', {'node': Strophe.NS.OMEMO_DEVICELIST}) .c('publish', {'node': Strophe.NS.OMEMO_DEVICELIST})
.c('item') .c('item')
.c('list', {'xmlns': Strophe.NS.OMEMO}) .c('list', {'xmlns': Strophe.NS.OMEMO})
_.each(this.devices.where({'active': true}), (device) => { _.each(this.devices.where({'active': true}), (device) => {
stanza.c('device', {'id': device.get('id')}).up(); stanza.c('device', {'id': device.get('id')}).up();
}); });
...@@ -929,10 +928,14 @@ ...@@ -929,10 +928,14 @@
function registerPEPPushHandler () { function registerPEPPushHandler () {
// Add a handler for devices pushed from other connected clients // Add a handler for devices pushed from other connected clients
_converse.connection.addHandler((message) => { _converse.connection.addHandler((message) => {
try {
if (sizzle(`event[xmlns="${Strophe.NS.PUBSUB}#event"]`, message).length) { if (sizzle(`event[xmlns="${Strophe.NS.PUBSUB}#event"]`, message).length) {
updateDevicesFromStanza(message); updateDevicesFromStanza(message);
updateBundleFromStanza(message); updateBundleFromStanza(message);
} }
} catch (e) {
_converse.log(e.message, Strophe.LogLevel.ERROR);
}
return true; return true;
}, null, 'message', 'headline'); }, null, 'message', 'headline');
} }
......
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