Merge pull request #4672 from node-red/allow-blank-env-var-substitutions

Allow blank strings to be used for env var property substitutions
This commit is contained in:
Nick O'Leary 2024-04-24 23:37:23 +02:00 committed by GitHub
commit cfb300ec06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -68,7 +68,7 @@ function mapEnvVarProperties(obj,prop,flow,config) {
if (obj[prop][0] === "$" && (EnvVarPropertyRE_old.test(v) || EnvVarPropertyRE.test(v)) ) { if (obj[prop][0] === "$" && (EnvVarPropertyRE_old.test(v) || EnvVarPropertyRE.test(v)) ) {
const envVar = v.substring(2,v.length-1); const envVar = v.substring(2,v.length-1);
const r = redUtil.getSetting(config, envVar, flow); const r = redUtil.getSetting(config, envVar, flow);
if (r !== undefined && r !== '') { if (r !== undefined) {
obj[prop] = r obj[prop] = r
} }
} }