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"