diff --git a/adaptor-xmpp.js b/adaptor-xmpp.js index a278b85..871101f 100644 --- a/adaptor-xmpp.js +++ b/adaptor-xmpp.js @@ -102,6 +102,15 @@ function setOptions(options) { } function sendMessage(destination, msg) { + if (!destination) { + logger.warn('adaptorXmpp.sendMessage: Undefined destination, send message aborted', {destination: destination, msg: msg}); + } + + if (!msg) { + logger.warn('adaptorXmpp.sendMessage: Undefined message, send message aborted', {destination: destination, msg: msg}); + } + + if (destination.toLowerCase() != username.replace(/\/.*/, '').toLowerCase()) { logger.verbose('Sending message', {from: username, destination: destination, msg: msg}); }