diff --git a/README.md b/README.md index 0e86c7e..0645d73 100644 --- a/README.md +++ b/README.md @@ -182,6 +182,7 @@ device id to be controlled. ## Version history +* _1.0.3_: Fixed handling of empty output values * _1.0.2_: Fixed handling of input values that are null or not a string * _1.0.1_: Some documentation updates & fixes * _1.0.0_: Initial version diff --git a/map.js b/map.js index cc80eab..3ccd939 100644 --- a/map.js +++ b/map.js @@ -114,7 +114,7 @@ module.exports = function(RED) { if ( !outValue && node.forwardIfNoMatch ) { outValue = mustache.render(node.defaultIfNoMatch, msg); } - if ( outValue ) { + if ( outValue || node.forwardIfNoMatch ) { RED.util.setMessageProperty(msg, node.out, outValue); node.send(msg); } @@ -141,10 +141,8 @@ module.exports = function(RED) { try { var outValue = node.config.getMappingValue('both', node.from, node.outLhsOrRhs, false); - if (outValue) { - RED.util.setMessageProperty(msg, node.out, outValue); - node.send(msg); - } + RED.util.setMessageProperty(msg, node.out, outValue); + node.send(msg); } catch(err) { node.error(err.message, msg); diff --git a/package.json b/package.json index 7df6eac..995ee9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-red-contrib-map", - "version": "1.0.2", + "version": "1.0.3", "description": "Map property values based on configurable mapping", "repository": { "type": "git",