[cherry-pick] Construct processInstance may NPE when master handling command (#14888)

This commit is contained in:
fuchanghai 2023-09-11 08:51:58 +08:00 committed by GitHub
parent e7bdefd875
commit fb52207cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -927,6 +927,9 @@ public class ProcessServiceImpl implements ProcessService {
throw new IllegalArgumentException("Cannot find the process definition for this workflowInstance");
}
Map<String, String> cmdParam = JSONUtils.toMap(command.getCommandParam());
if(cmdParam == null){
cmdParam = new HashMap<>();
}
int processInstanceId = command.getProcessInstanceId();
if (processInstanceId == 0) {
processInstance = generateNewProcessInstance(processDefinition, command, cmdParam);