Skip to content

Commit f0f389f

Browse files
barinalinikku
authored andcommitted
fix: resolve path expression on Any-typed variable as Any, not Null
Related to #87
1 parent bd8eb4e commit f0f389f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/zeebe/util/feelUtility.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,19 @@ function resolveReferences(variablesToResolve, allVariables) {
106106
computedResult.value.info = expression;
107107
}
108108

109+
// If the result is null but a referenced variable is "Any"-typed (unknown
110+
// structure), accessing a property on it should also yield "Any", not "Null".
111+
// cf. https://github.com/bpmn-io/variable-resolver/issues/87
112+
else if (computedResult.value.atomicValue === null &&
113+
unresolvedRoots.some(name => {
114+
const entry = scopedContext.entries[name];
115+
return entry instanceof EntriesContext &&
116+
getType(entry.value) === 'Any';
117+
})) {
118+
computedResult = EntriesContext.of(undefined);
119+
computedResult.value.info = expression;
120+
}
121+
109122
// Ensure we don't copy the scope from the mapped variable
110123
computedResult.scope = variable.scope;
111124

0 commit comments

Comments
 (0)