NPE when converting to BPMN a model with boundary event that is not attached to a task

Description

When by accident I leave an boundary event unattached to a task it throws a NullPointerException during the conversion to BPMN:

ObjectNode modelNode = (ObjectNode) new ObjectMapper().readTree(repositoryService.getModelEditorSource(modelData.getId()));
BpmnModel model = new BpmnJsonConverter().convertToBpmnModel(modelNode);

I realized that occurs when BpmnJsonConverter.postProcessElements tries to find the attached element to a BoundaryEvent. The method retrieveAttachedRefObject is not null safe, so it throws a NPE.

This should throw a more verbose exception, like "Boundary Event X is not attached to a task"

Environment

None

Assignee

Joram Barrez

Reporter

Silvio dos Passos Neto

Labels

None

Components

Fix versions

Affects versions

Priority

Minor
Configure