bpmn-io / bpmnlint

Validate BPMN diagrams based on configurable lint rules.
MIT License
121 stars 36 forks source link

Accessing null for removed labels #76

Closed epictecch closed 2 years ago

epictecch commented 2 years ago

After resetting a label using modeling.updateLabel(undefined), the ModdleElement looks like this: { $type: 'bpmndi:BPMNShape', label: null, ... }

The label being null leads to accessing null in traverse.js:

rule <fake-join> failed with error:  TypeError: Cannot read properties of null (reading '$instanceOf')
    at is$7 (lintRules.js:37:1)
    at lintRules.js:53:1
    at Array.some (<anonymous>)
    at isAny$4 (lintRules.js:52:1)
    at check (lintRules.js:118:1)
    at traverse.enter (test-rule.js:70:1)
    at traverse (traverse.js:13:1)
    at traverse.js:32:1
    at Array.forEach (<anonymous>)
    at traverse (traverse.js:23:1)

This behaviour has been reported to the bpmn.io forum and has been classified as bug in bpmnlint. See discussion.

marstamm commented 2 years ago

related to https://github.com/bpmn-io/bpmn-js/issues/1637

nikku commented 2 years ago

Fixed upstream via https://github.com/bpmn-io/bpmn-js/issues/1637.

nikku commented 2 years ago

Fixed in bpmn-js@9.x: https://github.com/bpmn-io/bpmn-js/commit/c550d09d1d0ce9132ed51d38aa3764bf080ab290.