Handle undefined env vars

Fixes #4579
This commit is contained in:
Nick O'Leary 2024-02-26 16:17:09 +00:00
parent 9a32ebd0c0
commit fa78bb3d78
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 3 additions and 3 deletions

View File

@ -485,7 +485,7 @@ class Flow {
} }
if (!key.startsWith("$parent.")) { if (!key.startsWith("$parent.")) {
if (this._env.hasOwnProperty(key)) { if (this._env.hasOwnProperty(key)) {
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key] return (this._env[key] && Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
} }
} else { } else {
key = key.substring(8); key = key.substring(8);

View File

@ -41,7 +41,7 @@ class Group {
} }
if (!key.startsWith("$parent.")) { if (!key.startsWith("$parent.")) {
if (this._env.hasOwnProperty(key)) { if (this._env.hasOwnProperty(key)) {
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key] return (this._env[key] && Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
} }
} else { } else {
key = key.substring(8); key = key.substring(8);

View File

@ -376,7 +376,7 @@ class Subflow extends Flow {
} }
if (!key.startsWith("$parent.")) { if (!key.startsWith("$parent.")) {
if (this._env.hasOwnProperty(key)) { if (this._env.hasOwnProperty(key)) {
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key] return (this._env[key] && Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
} }
} else { } else {
key = key.substring(8); key = key.substring(8);