fix pushover to handle false msg.payload

to close #756
This commit is contained in:
Dave Conway-Jones 2021-02-11 21:17:59 +00:00
parent 67fee810eb
commit b1a2741fa0
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 2 additions and 2 deletions

View File

@ -42,7 +42,7 @@ module.exports = function(RED) {
if (isNaN(pri)) {pri=0;}
if (pri > 2) {pri = 2;}
if (pri < -2) {pri = -2;}
if (!msg.payload) { msg.payload = ""; }
if (typeof msg.payload === 'undefined') { msg.payload = "(undefined msg.payload)"; }
if (typeof(msg.payload) === 'object') {
msg.payload = JSON.stringify(msg.payload);
}

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-pushover",
"version" : "0.0.20",
"version" : "0.0.21",
"description" : "A Node-RED node to send alerts via Pushover",
"dependencies" : {
"pushover-notifications" : "^1.2.2"