Skip to content
This repository was archived by the owner on Oct 21, 2025. It is now read-only.

Commit 54c4c70

Browse files
committed
disallow empty names
1 parent a3a1fca commit 54c4c70

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/features/dfdElements/editLabelValidator.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class DfdEditLabelValidator implements IEditLabelValidator {
2727
}
2828

2929
const labelParent = label.parent;
30-
if (!(labelParent instanceof SEdgeImpl) || !value) {
30+
if (!(labelParent instanceof SEdgeImpl)) {
3131
return { severity: "ok" };
3232
}
3333

@@ -36,6 +36,11 @@ export class DfdEditLabelValidator implements IEditLabelValidator {
3636
return { severity: "error", message: "Input name cannot contain spaces" };
3737
}
3838

39+
// Labels on edges are not allowed to be empty
40+
if (value.length == 0) {
41+
return { severity: "error", message: "Input name cannot be empty" };
42+
}
43+
3944
// Get node and edge names that are in use
4045
const edge = labelParent;
4146
const edgeTarget = edge.target;

0 commit comments

Comments
 (0)