mirror of
https://github.com/stan-smith/FossFLOW.git
synced 2026-04-23 08:31:16 -04:00
feat: adds validation check for connectors with less than 2 anchors
This commit is contained in:
@@ -58,6 +58,12 @@ export const ensureValidConnector = (
|
||||
allAnchors: ConnectorAnchor[],
|
||||
nodes: NodeInput[]
|
||||
) => {
|
||||
if (connector.anchors.length < 2) {
|
||||
throw new Error(
|
||||
`Found invalid connector [id: "${connector.id}"]: A connector must have at least 2 anchors.`
|
||||
);
|
||||
}
|
||||
|
||||
connector.anchors.forEach((anchor) => {
|
||||
try {
|
||||
ensureValidConnectorAnchor(anchor, allAnchors, nodes);
|
||||
|
||||
Reference in New Issue
Block a user