Fix wrong argument in change node (#1415)

and add test cases
This commit is contained in:
Hiroki Uchikawa
2017-09-28 18:06:31 +09:00
committed by Nick O'Leary
parent 039bd1ddc0
commit 81256279a8
2 changed files with 98 additions and 1 deletions

View File

@@ -201,7 +201,7 @@ module.exports = function(RED) {
} else if (rule.t === 'set') {
target.set(property,value);
} else if (rule.t === 'change') {
current = target.get(msg,property);
current = target.get(property);
if (typeof current === 'string') {
if ((fromType === 'num' || fromType === 'bool' || fromType === 'str') && current === fromValue) {
// str representation of exact from number/boolean