fix: add null check to connection validation message#364
fix: add null check to connection validation message#364tbouffard merged 4 commits intomaxGraph:mainfrom
Conversation
|
This specifically needs to check for an empty string because |
caf50de to
073dbd1
Compare
|
Sorry for the late answer, I don't have time to review this PR for now. |
|
Apparently, the Validation story reproduces the original problem (see #73), so it should work with this fix. |
tbouffard
left a comment
There was a problem hiding this comment.
I have not been able to reproduce the problem with the Validation story. The null check in Multiplicity.checkTerminal remove errors in the Story.
As the proposed fix restores the mxGraph implementation, this is OK for now. Improvements of the error management can be done later.
Notice that the Validation story shows that the error message are not correctly display. A "key" is used instead of the actual error message. Fixing this problem was out of the scope of this PR.
Here is how the Validation story behaves with this PR 👇🏿

Summary
If-statement in ConnectionHandlerCellMarker was looking for
this.connectionHandler.errorto be an empty string, but used checkthis.connectionHandler.error && this.connectionHandler.error.length === 0, which is false when the string is empty because""is falsy. Reverted to the syntax used in mxgraph. This was noticed by issue #362Description for the changelog
Add null check to connection validation message in ConnectionHandlerCellMarker to handler invalid connection targets.
Closes #362