mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Prevent connecting nodes with the same ID
This commit is contained in:
parent
9694c8bdfa
commit
480cd0b8ef
@ -3070,6 +3070,10 @@ RED.nodes = (function() {
|
||||
})
|
||||
}
|
||||
targetNodes.forEach(target => {
|
||||
// Two nodes with the same ID cannot be connected to each other.
|
||||
if(sourceNode.id === target.id) {
|
||||
return
|
||||
}
|
||||
let linkId = `${sourceNode.id}[${inLink.sourcePort}] -> ${target.id}`
|
||||
if (!createdLinkIds.has(linkId)) {
|
||||
createdLinkIds.add(linkId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user