NPE when retrieving a local variable with a null value multiple times

Description

A NullPointerException occurs when retrieving a local variable with a null value multiple times from a JavaService task via the following call.

runtimeService.getVariableLocal(execution.getProcessInstanceId(),"variableName");

The root cause of the exception is the variable and (null) value being added to the usedVariablesCache on the first call and the following call entering the following code block resulting in a NPE.

if (usedVariablesCache.containsKey(variableName)) {
return usedVariablesCache.get(variableName).getValue();
}

Environment

None

Assignee

Joram Barrez

Reporter

Robert Hafner

Labels

None

Components

Fix versions

Affects versions

Priority

Major
Configure