Skip to content

Commit

Permalink
Remove 'safe navigation operator' usage on bpmnElement
Browse files Browse the repository at this point in the history
It must never be null or undefined (if so this is a bug elsewhere), so drop it
for simplicity.
  • Loading branch information
tbouffard committed Mar 2, 2021
1 parent 5ad23ce commit 7dd96bf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/component/registry/bpmn-model-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ function toRenderedModel(bpmnModel: BpmnModel): RenderedModel {
const collapsedSubProcessIds: string[] = bpmnModel.flowNodes
.filter(shape => {
const bpmnElement = shape.bpmnElement;
return ShapeUtil.isSubProcess(bpmnElement?.kind) && (bpmnElement as ShapeBpmnSubProcess)?.markers.includes(ShapeBpmnMarkerKind.EXPAND);
return ShapeUtil.isSubProcess(bpmnElement.kind) && (bpmnElement as ShapeBpmnSubProcess).markers.includes(ShapeBpmnMarkerKind.EXPAND);
})
.map(shape => shape.bpmnElement?.id);
.map(shape => shape.bpmnElement.id);

const subprocesses: Shape[] = [];
const boundaryEvents: Shape[] = [];
const otherFlowNodes: Shape[] = [];
bpmnModel.flowNodes.forEach(shape => {
const kind = shape.bpmnElement?.kind;
const kind = shape.bpmnElement.kind;
if (ShapeUtil.isSubProcess(kind)) {
subprocesses.push(shape);
} else if (ShapeUtil.isBoundaryEvent(kind)) {
boundaryEvents.push(shape);
} else if (!collapsedSubProcessIds.includes(shape.bpmnElement?.parentId)) {
} else if (!collapsedSubProcessIds.includes(shape.bpmnElement.parentId)) {
otherFlowNodes.push(shape);
}
});
Expand Down

0 comments on commit 7dd96bf

Please sign in to comment.