From d4fd1fdb7e6bd995b0684f686ca5b7fb3fbb39d6 Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Fri, 14 Apr 2023 18:43:46 +0100 Subject: [PATCH] Warn if msgs missing payload property to close #229 --- CHANGELOG.md | 5 +++-- README.md | 5 +++-- package.json | 2 +- worldmap.js | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1e486d..84465c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ ### Change Log for Node-RED Worldmap + - v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229 - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225) - v2.36.0 - Add edge icons for SIDC markers just off the map. - v2.35.0 - Let clickable:false work for markers as well. - - v2.34.0 - Let icon "url" be a local fixed path (PR #223) - - v2.33.0 - Let shapes create click event. (from PR #221) + - v2.34.0 - Let icon "url" be a local fixed path. PR #223 + - v2.33.0 - Let shapes create click event. from PR #221 Fix heatmap delete point bug. Issue #222 - v2.32.3 - Fix map split in iframe position - v2.32.1 - Let command.heatmap replace complete heatmap array. diff --git a/README.md b/README.md index 8d59802..210d56f 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,12 @@ map web page for plotting "things" on. ### Updates +- v2.37.1 - Warn (and drop) messages that are missing a payload. Issue #229 - v2.37.0 - Allow fly instead of fit option when using command to move view window. (PR #225) - v2.36.0 - Add edge icons for SIDC markers just off the map. - v2.35.0 - Let clickable:false work for markers as well. -- v2.34.0 - Let icon "url" be a local fixed path (PR #223) -- v2.33.0 - Let shapes create click event. (from PR #221) +- v2.34.0 - Let icon "url" be a local fixed path. PR #223 +- v2.33.0 - Let shapes create click event. from PR #221 Fix heatmap delete point bug. Issue #222 - v2.32.2 - Fix map split in iframe position - v2.32.1 - Let command.map.heatmap replace complete heatmap array. diff --git a/package.json b/package.json index 8301667..ffd749b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-web-worldmap", - "version": "2.37.0", + "version": "2.37.1", "description": "A Node-RED node to provide a web page of a world map for plotting things on.", "dependencies": { "@turf/bezier-spline": "~6.5.0", diff --git a/worldmap.js b/worldmap.js index ea493dd..c57d39f 100644 --- a/worldmap.js +++ b/worldmap.js @@ -121,6 +121,7 @@ module.exports = function(RED) { node.status({fill:"green",shape:"dot",text:"connected "+Object.keys(clients).length,_sessionid:client.id}); } node.on('input', function(msg) { + if (!msg.hasOwnProperty("payload")) { node.warn("Missing payload"); return; } if (msg.hasOwnProperty("_sessionid")) { if (clients.hasOwnProperty(msg._sessionid)) { clients[msg._sessionid].write(JSON.stringify(msg.payload));