Handle false values in $env() properly

Fixes 2517
This commit is contained in:
Nick O'Leary 2020-03-27 09:05:58 +00:00
parent 9b6e798eb6
commit 1018c0e8a5
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
1 changed files with 5 additions and 1 deletions

View File

@ -566,7 +566,11 @@ function prepareJSONataExpression(value,node) {
});
expr.assign('env', function(name) {
var val = getSetting(node, name);
return (val ? val : "");
if (typeof val !== 'undefined') {
return val;
} else {
return ""
}
})
expr.registerFunction('clone', cloneMessage, '<(oa)-:o>');
expr._legacyMode = /(^|[^a-zA-Z0-9_'"])msg([^a-zA-Z0-9_'"]|$)/.test(value);