Generated form constraint bug: Cannot read property 'type' of undefined

I have found a bug in the generated task form when using a constraint.
It seems that when you add one of these constraints (min/maxlength, min, max) to the form field, fill any field with the constraint to trigger the validation and then repeatedly press the “Complete” button, form will eventually (3rd press) show this error: “Cannot read property ‘type’ of undefined” and then you can not complete the form, even when you fill all fields correctly. You can “reset” the form (click on the diagram and back to form) to proceed if you need.

Steps to reproduce:

  1. start process “testConstraint”
  2. claim task “test task”
  3. fill any of the fields from the sample process to trigger the validation so the form cannot be completed
  4. click on the “Complete” button, 3 times

testConstraint.bpmn (3.6 KB)