Warn if msgs missing payload property

to close #229
This commit is contained in:
Dave Conway-Jones 2023-04-14 18:43:46 +01:00
parent 1225cb36d2
commit d4fd1fdb7e
No known key found for this signature in database
GPG Key ID: 1DDB0E91A28C2643
4 changed files with 8 additions and 5 deletions

View File

@ -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.

View File

@ -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.

View File

@ -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",

View File

@ -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));