diff --git a/social/xmpp/92-xmpp.js b/social/xmpp/92-xmpp.js index 7e9d0967..160562b3 100644 --- a/social/xmpp/92-xmpp.js +++ b/social/xmpp/92-xmpp.js @@ -188,7 +188,7 @@ module.exports = function(RED) { if (RED.settings.verbose || LOGITALL) {that.log("got an iq query"); } if (stanza.attrs.type === 'error') { if (RED.settings.verbose || LOGITALL) {that.log("oh noes, it's an error"); } - if (that && that.hasOwnProperty("lastUsed") && that.lastUsed.hasOwnProperty("id") && stanza.attrs.id === that.lastUsed.id) { + if (that?.lastUsed?.id && stanza.attrs.id === that.lastUsed.id) { that.lastUsed.status({fill:"red", shape:"ring", text:stanza.getChild('error')}); that.lastUsed.warn(stanza.getChild('error')); } @@ -529,7 +529,7 @@ module.exports = function(RED) { statusText = status.getText() || "online"; } - if (statusText !== "" && (stanza.attrs.from !== stanza.attrs.to)) { + if (statusText !== "" && stanza.attrs.from && (stanza.attrs.from !== stanza.attrs.to)) { var from = stanza.attrs.from; var msg = { topic:from, diff --git a/social/xmpp/package.json b/social/xmpp/package.json index 56f03ec0..9a8f5c0c 100644 --- a/social/xmpp/package.json +++ b/social/xmpp/package.json @@ -1,6 +1,6 @@ { "name": "node-red-node-xmpp", - "version": "0.6.1", + "version": "0.6.2", "description": "A Node-RED node to talk to an XMPP server", "dependencies": { "@xmpp/client": "^0.13.1"