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:
parent
fc9cdb61f2
commit
b0d7e11d48
@ -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') {
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user