Skip to content

Commit

Permalink
fix: VariableResolver can return null (#771)
Browse files Browse the repository at this point in the history
(cherry picked from commit b1f23c6)
  • Loading branch information
jonathanlukas committed Apr 30, 2024
1 parent 5c7ff64 commit 6afcd8d
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public VariableResolver(String variableName, Class<?> variableType, JsonMapper j
@Override
public Object resolve(JobClient jobClient, ActivatedJob job) {
Object variableValue = getVariable(job);
if (variableValue == null) {
return null;
}
try {
return mapZeebeVariable(variableValue);
} catch (ClassCastException | IllegalArgumentException ex) {
Expand All @@ -32,7 +35,7 @@ public Object resolve(JobClient jobClient, ActivatedJob job) {
}

protected Object getVariable(ActivatedJob job) {
return job.getVariable(variableName);
return job.getVariablesAsMap().get(variableName);
}

protected Object mapZeebeVariable(Object variableValue) {
Expand Down

0 comments on commit 6afcd8d

Please sign in to comment.