1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix evaluateNodeProperty handling of unknown types

This commit is contained in:
Nick O'Leary 2018-07-09 12:40:25 +01:00
parent fc9cdb61f2
commit b0d7e11d48
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
2 changed files with 5 additions and 1 deletions

View File

@ -335,7 +335,7 @@ var parseContextStore = function(key) {
}
function evaluateNodeProperty(value, type, node, msg, callback) {
var result;
var result = value;
if (type === 'str') {
result = ""+value;
} else if (type === 'num') {

View File

@ -307,6 +307,10 @@ describe("red/util", function() {
},{});
result.should.eql("123");
});
it('returns null', function() {
var result = util.evaluateNodeProperty(null,'null');
(result === null).should.be.true();
})
describe('environment variable', function() {
before(function() {
process.env.NR_TEST_A = "foo";