Skip to content

Commit

Permalink
Fixed handling of input values that are null or not a string
Browse files Browse the repository at this point in the history
  • Loading branch information
rsenden committed Jun 6, 2019
1 parent ec7cdde commit 210d26c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ device id to be controlled.

## Version history

* _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

2 changes: 2 additions & 0 deletions map.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module.exports = function(RED) {
* - 'both': Match the given key value against '[LHS]|[RHS]' of the configured mappings
*/
this.getMapping = function(lhsOrRhsOrBothForKey, keyValue, caseInsensitive) {
if ( !keyValue ) { return null; }
keyValue = String(keyValue);
if ( caseInsensitive ) {
keyValue = keyValue.toLowerCase();
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-map",
"version": "1.0.1",
"version": "1.0.2",
"description": "Map property values based on configurable mapping",
"repository": {
"type": "git",
Expand Down

0 comments on commit 210d26c

Please sign in to comment.