Commit c46d937e authored by JC Brand's avatar JC Brand

Fix null check

parent 67958bba
...@@ -65432,11 +65432,13 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-mam ...@@ -65432,11 +65432,13 @@ _converse_core__WEBPACK_IMPORTED_MODULE_2__["default"].plugins.add('converse-mam
this.clearSpinner(); this.clearSpinner();
_.each(messages, message_handler); _.each(messages, message_handler);
}, () => { }, e => {
// Error // Error
this.clearSpinner(); this.clearSpinner();
_converse.log("Error or timeout while trying to fetch " + "archived messages", Strophe.LogLevel.ERROR); _converse.log("Error or timeout while trying to fetch " + "archived messages", Strophe.LogLevel.ERROR);
_converse.log(e, Strophe.LogLevel.ERROR);
}); });
}, () => { }, () => {
// Error // Error
...@@ -66911,9 +66913,9 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc ...@@ -66911,9 +66913,9 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
*/ */
this.fetchFeaturesIfConfigurationChanged(stanza); this.fetchFeaturesIfConfigurationChanged(stanza);
const original_stanza = stanza, const original_stanza = stanza,
forwarded = stanza.querySelector('forwarded'); forwarded = sizzle(`forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).pop();
if (!_.isNull(forwarded)) { if (forwarded) {
stanza = forwarded.querySelector('message'); stanza = forwarded.querySelector('message');
} }
...@@ -66944,7 +66946,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc ...@@ -66944,7 +66946,7 @@ _converse_core__WEBPACK_IMPORTED_MODULE_6__["default"].plugins.add('converse-muc
const msg = await this.createMessage(stanza, original_stanza); const msg = await this.createMessage(stanza, original_stanza);
if (!_.isNull(forwarded) && msg && msg.get('sender') === 'me') { if (forwarded && msg && msg.get('sender') === 'me') {
msg.save({ msg.save({
'received': moment().format() 'received': moment().format()
}); });
...@@ -955,7 +955,7 @@ converse.plugins.add('converse-muc', { ...@@ -955,7 +955,7 @@ converse.plugins.add('converse-muc', {
const original_stanza = stanza, const original_stanza = stanza,
forwarded = sizzle(`forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).pop(); forwarded = sizzle(`forwarded[xmlns="${Strophe.NS.FORWARD}"]`, stanza).pop();
if (!_.isNull(forwarded)) { if (forwarded) {
stanza = forwarded.querySelector('message'); stanza = forwarded.querySelector('message');
} }
if (this.isDuplicate(stanza)) { if (this.isDuplicate(stanza)) {
...@@ -975,7 +975,7 @@ converse.plugins.add('converse-muc', { ...@@ -975,7 +975,7 @@ converse.plugins.add('converse-muc', {
u.safeSave(this, {'subject': {'author': sender, 'text': subject}}); u.safeSave(this, {'subject': {'author': sender, 'text': subject}});
} }
const msg = await this.createMessage(stanza, original_stanza); const msg = await this.createMessage(stanza, original_stanza);
if (!_.isNull(forwarded) && msg && msg.get('sender') === 'me') { if (forwarded && msg && msg.get('sender') === 'me') {
msg.save({'received': moment().format()}); msg.save({'received': moment().format()});
} }
this.incrementUnreadMsgCounter(msg); this.incrementUnreadMsgCounter(msg);
......
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